Class: CyberSource::KeymanagementApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of KeymanagementApi.



19
20
21
22
# File 'lib/cybersource_rest_client/api/keymanagement_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/keymanagement_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#search_keys(opts = {}) ⇒ InlineResponse2001

Search Keys Search one or more Keys

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    This allows you to specify the page offset from the resulting list resultset you want the records to be returned

  • :limit (Integer)

    This allows you to specify the total number of records to be returned off the resulting list resultset

  • :sort (String)

    This allows you to specify a comma separated list of fields in the order which the resulting list resultset must be sorted.

  • :organization_ids (Array<String>)

    List of Orgaization Ids to search. The maximum size of the organization Ids list is 1. The maximum length of Organization Id is 30.

  • :key_ids (Array<String>)

    List of Key Ids to search. The maximum size of the Key Ids list is 1

  • :key_types (Array<String>)

    Key Type, Possible values - certificate, password, pgp and scmp_api. When Key Type is provided atleast one more filter needs to be provided

  • :expiration_start_date (DateTime)

    Expiry Filter Start Date. When Expiration Date filter is provided, atleast one more filter needs to be provided

  • :expiration_end_date (DateTime)

    Expiry Filter End Date. When Expiration Date filter is provided, atleast one more filter needs to be provided

Returns:



37
38
39
40
# File 'lib/cybersource_rest_client/api/keymanagement_api.rb', line 37

def search_keys(opts = {})
  data, status_code, headers = search_keys_with_http_info(opts)
  return data, status_code, headers
end

#search_keys_with_http_info(opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

Search Keys Search one or more Keys

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    This allows you to specify the page offset from the resulting list resultset you want the records to be returned

  • :limit (Integer)

    This allows you to specify the total number of records to be returned off the resulting list resultset

  • :sort (String)

    This allows you to specify a comma separated list of fields in the order which the resulting list resultset must be sorted.

  • :organization_ids (Array<String>)

    List of Orgaization Ids to search. The maximum size of the organization Ids list is 1. The maximum length of Organization Id is 30.

  • :key_ids (Array<String>)

    List of Key Ids to search. The maximum size of the Key Ids list is 1

  • :key_types (Array<String>)

    Key Type, Possible values - certificate, password, pgp and scmp_api. When Key Type is provided atleast one more filter needs to be provided

  • :expiration_start_date (DateTime)

    Expiry Filter Start Date. When Expiration Date filter is provided, atleast one more filter needs to be provided

  • :expiration_end_date (DateTime)

    Expiry Filter End Date. When Expiration Date filter is provided, atleast one more filter needs to be provided

Returns:

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

    InlineResponse2001 data, response status code and response headers



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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cybersource_rest_client/api/keymanagement_api.rb', line 54

def search_keys_with_http_info(opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: KeymanagementApi.search_keys ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  #if @api_client.config.client_side_validation && !opts[:'expiration_start_date'].nil? && opts[:'expiration_start_date'] !~ Regexp.new(/yyyy-mm-dd/)
    #fail ArgumentError, "invalid value for 'opts[:\"expiration_start_date\"]' when calling KeymanagementApi.search_keys, must conform to the pattern /yyyy-mm-dd/."
  #end

  #if @api_client.config.client_side_validation && !opts[:'expiration_end_date'].nil? && opts[:'expiration_end_date'] !~ Regexp.new(/yyyy-mm-dd/)
    #fail ArgumentError, "invalid value for 'opts[:\"expiration_end_date\"]' when calling KeymanagementApi.search_keys, must conform to the pattern /yyyy-mm-dd/."
  #end

  # resource path
  local_var_path = 'kms/v2/keys'

  # query parameters
  query_params = {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'organizationIds'] = @api_client.build_collection_param(opts[:'organization_ids'], :csv) if !opts[:'organization_ids'].nil?
  query_params[:'keyIds'] = @api_client.build_collection_param(opts[:'key_ids'], :csv) if !opts[:'key_ids'].nil?
  query_params[:'keyTypes'] = @api_client.build_collection_param(opts[:'key_types'], :csv) if !opts[:'key_types'].nil?
  query_params[:'expirationStartDate'] = opts[:'expiration_start_date'] if !opts[:'expiration_start_date'].nil?
  query_params[:'expirationEndDate'] = opts[:'expiration_end_date'] if !opts[:'expiration_end_date'].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 => 'InlineResponse2001')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: KeymanagementApi#search_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end