Class: WorkOS::CreateOAuthApplication

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/connect/create_oauth_application.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  application_type: :application_type,
  description: :description,
  scopes: :scopes,
  redirect_uris: :redirect_uris,
  cors_origins: :cors_origins,
  uses_pkce: :uses_pkce,
  is_first_party: :is_first_party,
  organization_id: :organization_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CreateOAuthApplication

Returns a new instance of CreateOAuthApplication.



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/workos/connect/create_oauth_application.rb', line 30

def initialize(json)
  hash = self.class.normalize(json)
  @name = hash[:name]
  @application_type = hash[:application_type]
  @description = hash[:description]
  @scopes = hash[:scopes] || []
  @redirect_uris = (hash[:redirect_uris] || []).map { |item| item ? WorkOS::RedirectUriInput.new(item) : nil }
  @cors_origins = hash[:cors_origins] || []
  @uses_pkce = hash[:uses_pkce]
  @is_first_party = hash[:is_first_party]
  @organization_id = hash[:organization_id]
end

Instance Attribute Details

#application_type ⇒ Object

Returns the value of attribute application_type.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def application_type
  @application_type
end

#cors_origins ⇒ Object

Returns the value of attribute cors_origins.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def cors_origins
  @cors_origins
end

#description ⇒ Object

Returns the value of attribute description.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def description
  @description
end

#is_first_party ⇒ Object

Returns the value of attribute is_first_party.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def is_first_party
  @is_first_party
end

#name ⇒ Object

Returns the value of attribute name.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def name
  @name
end

#organization_id ⇒ Object

Returns the value of attribute organization_id.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def organization_id
  @organization_id
end

#redirect_uris ⇒ Object

Returns the value of attribute redirect_uris.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def redirect_uris
  @redirect_uris
end

#scopes ⇒ Object

Returns the value of attribute scopes.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def scopes
  @scopes
end

#uses_pkce ⇒ Object

Returns the value of attribute uses_pkce.



19
20
21
# File 'lib/workos/connect/create_oauth_application.rb', line 19

def uses_pkce
  @uses_pkce
end