Class: PermitApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/api/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, logger) ⇒ PermitApiClient

Returns a new instance of PermitApiClient.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/api/api.rb', line 11

def initialize(config, logger)

  OpenapiClient.configure do |openapi_config|
    openapi_config.scheme = Utils.get_schema_from_url(config.api_url)
    openapi_config.host = Utils.get_host_from_url(config.api_url)
    openapi_config.access_token = config.token
    openapi_config.server_operation_index = {}
    openapi_config.server_index = nil
  end
  @config = config
  @logger = logger
  @users = UsersApi.new(OpenapiClient::UsersApi.new, config, logger)
  @tenants = TenantsApi.new(OpenapiClient::TenantsApi.new, config, logger)
  @resources = ResourcesApi.new(OpenapiClient::ResourcesApi.new, config, logger)
  # @roles = RolesApi.new(OpenapiClient::RolesApi.new, config, logger)
  @elements = ElementsApi.new(OpenapiClient::AuthenticationApi.new, config, logger)
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



9
10
11
# File 'lib/api/api.rb', line 9

def client
  @client
end

#configObject

Returns the value of attribute config.



9
10
11
# File 'lib/api/api.rb', line 9

def config
  @config
end

#elementsObject

Returns the value of attribute elements.



9
10
11
# File 'lib/api/api.rb', line 9

def elements
  @elements
end

#loggerObject

Returns the value of attribute logger.



9
10
11
# File 'lib/api/api.rb', line 9

def logger
  @logger
end

#resourcesObject

Returns the value of attribute resources.



9
10
11
# File 'lib/api/api.rb', line 9

def resources
  @resources
end

#rolesObject

Returns the value of attribute roles.



9
10
11
# File 'lib/api/api.rb', line 9

def roles
  @roles
end

#tenantsObject

Returns the value of attribute tenants.



9
10
11
# File 'lib/api/api.rb', line 9

def tenants
  @tenants
end

#usersObject

Returns the value of attribute users.



9
10
11
# File 'lib/api/api.rb', line 9

def users
  @users
end