Class: CyberSource::UserManagementApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ UserManagementApi

Returns a new instance of UserManagementApi.



19
20
21
22
# File 'lib/cybersource_rest_client/api/user_management_api.rb', line 19

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
  @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cybersource_rest_client/api/user_management_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_users(opts = {}) ⇒ UmsV1UsersGet200Response

Get User Information - Deprecated This endpoint is deprecated. Please use the search end point.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :organization_id (String)

    This is the orgId of the organization which the user belongs to.

  • :user_name (String)

    User ID of the user you want to get details on.

  • :permission_id (String)

    permission that you are trying to search user on.

  • :role_id (String)

    role of the user you are trying to search on.

Returns:



33
34
35
36
# File 'lib/cybersource_rest_client/api/user_management_api.rb', line 33

def get_users(opts = {})
  data, status_code, headers = get_users_with_http_info(opts)
  return data, status_code, headers
end

#get_users_with_http_info(opts = {}) ⇒ Array<(UmsV1UsersGet200Response, Fixnum, Hash)>

Get User Information - Deprecated This endpoint is deprecated. Please use the search end point.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :organization_id (String)

    This is the orgId of the organization which the user belongs to.

  • :user_name (String)

    User ID of the user you want to get details on.

  • :permission_id (String)

    permission that you are trying to search user on.

  • :role_id (String)

    role of the user you are trying to search on.

Returns:

  • (Array<(UmsV1UsersGet200Response, Fixnum, Hash)>)

    UmsV1UsersGet200Response data, response status code and response headers



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/cybersource_rest_client/api/user_management_api.rb', line 46

def get_users_with_http_info(opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: UserManagementApi.get_users ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # resource path
  local_var_path = 'ums/v1/users'

  # query parameters
  query_params = {}
  query_params[:'organizationId'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
  query_params[:'userName'] = opts[:'user_name'] if !opts[:'user_name'].nil?
  query_params[:'permissionId'] = opts[:'permission_id'] if !opts[:'permission_id'].nil?
  query_params[:'roleId'] = opts[:'role_id'] if !opts[:'role_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UmsV1UsersGet200Response')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: UserManagementApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end