Class: TrinsicApi::VerificationProfilesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VerificationProfilesApi

Returns a new instance of VerificationProfilesApi.



19
20
21
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_verification_profile(_alias, brand_name, opts = {}) ⇒ CreateVerificationProfileResponse

Create Verification Profile Creates a new verification profile within your organization.

Parameters:

  • _alias (String)

    An alias of the verification profile shown to developers and administrators.

  • brand_name (String)

    The brand name of the verification profile shown to end-users.

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

    the optional parameters

Options Hash (opts):

  • :primary_color (String)

    The primary color of the verification profile. Must be a 6-character hex string prefixed with a '#' character. Example: #000000

  • :providers (Array<String>)

    The list of providers you&#39;d like to select for this profile. We will not currently enable any providers.

  • :logo (File)

    The logo of the verification profile.

  • :redaction_period (String)

    The redaction period for verification data. Must be between 0 and 31 days, and at least 15 minutes greater than the session expiration. If not specified, defaults to 31 days.

  • :session_expiration (String)

    The session expiration for verification sessions created with this profile. Must be between 15 minutes and 24 hours. Defaults to 1 hour if not specified.

  • :is_production_usage (Boolean)

    Whether this profile is for production usage. Only applicable for Live environment profiles. If not specified for Live profiles, defaults to false (Demo).

Returns:



34
35
36
37
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 34

def create_verification_profile(_alias, brand_name, opts = {})
  data, _status_code, _headers = create_verification_profile_with_http_info(_alias, brand_name, opts)
  data
end

#create_verification_profile_with_http_info(_alias, brand_name, opts = {}) ⇒ Array<(CreateVerificationProfileResponse, Integer, Hash)>

Create Verification Profile Creates a new verification profile within your organization.

Parameters:

  • _alias (String)

    An alias of the verification profile shown to developers and administrators.

  • brand_name (String)

    The brand name of the verification profile shown to end-users.

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

    the optional parameters

Options Hash (opts):

  • :primary_color (String)

    The primary color of the verification profile. Must be a 6-character hex string prefixed with a &#39;#&#39; character. Example: #000000

  • :providers (Array<String>)

    The list of providers you&#39;d like to select for this profile. We will not currently enable any providers.

  • :logo (File)

    The logo of the verification profile.

  • :redaction_period (String)

    The redaction period for verification data. Must be between 0 and 31 days, and at least 15 minutes greater than the session expiration. If not specified, defaults to 31 days.

  • :session_expiration (String)

    The session expiration for verification sessions created with this profile. Must be between 15 minutes and 24 hours. Defaults to 1 hour if not specified.

  • :is_production_usage (Boolean)

    Whether this profile is for production usage. Only applicable for Live environment profiles. If not specified for Live profiles, defaults to false (Demo).

Returns:



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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 51

def create_verification_profile_with_http_info(_alias, brand_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VerificationProfilesApi.create_verification_profile ...'
  end
  # verify the required parameter '_alias' is set
  if @api_client.config.client_side_validation && _alias.nil?
    fail ArgumentError, "Missing the required parameter '_alias' when calling VerificationProfilesApi.create_verification_profile"
  end
  if @api_client.config.client_side_validation && _alias.to_s.length > 255
    fail ArgumentError, 'invalid value for "_alias" when calling VerificationProfilesApi.create_verification_profile, the character length must be smaller than or equal to 255.'
  end

  if @api_client.config.client_side_validation && _alias.to_s.length < 1
    fail ArgumentError, 'invalid value for "_alias" when calling VerificationProfilesApi.create_verification_profile, the character length must be great than or equal to 1.'
  end

  # verify the required parameter 'brand_name' is set
  if @api_client.config.client_side_validation && brand_name.nil?
    fail ArgumentError, "Missing the required parameter 'brand_name' when calling VerificationProfilesApi.create_verification_profile"
  end
  if @api_client.config.client_side_validation && brand_name.to_s.length > 2500
    fail ArgumentError, 'invalid value for "brand_name" when calling VerificationProfilesApi.create_verification_profile, the character length must be smaller than or equal to 2500.'
  end

  if @api_client.config.client_side_validation && brand_name.to_s.length < 1
    fail ArgumentError, 'invalid value for "brand_name" when calling VerificationProfilesApi.create_verification_profile, the character length must be great than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'primary_color'].nil? && opts[:'primary_color'].to_s.length > 7
    fail ArgumentError, 'invalid value for "opts[:"primary_color"]" when calling VerificationProfilesApi.create_verification_profile, the character length must be smaller than or equal to 7.'
  end

  if @api_client.config.client_side_validation && !opts[:'primary_color'].nil? && opts[:'primary_color'].to_s.length < 7
    fail ArgumentError, 'invalid value for "opts[:"primary_color"]" when calling VerificationProfilesApi.create_verification_profile, the character length must be great than or equal to 7.'
  end

  # resource path
  local_var_path = '/api/valpha/verification-profiles'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['Alias'] = _alias
  form_params['BrandName'] = brand_name
  form_params['PrimaryColor'] = opts[:'primary_color'] if !opts[:'primary_color'].nil?
  form_params['Providers'] = @api_client.build_collection_param(opts[:'providers'], :multi) if !opts[:'providers'].nil?
  form_params['Logo'] = opts[:'logo'] if !opts[:'logo'].nil?
  form_params['RedactionPeriod'] = opts[:'redaction_period'] if !opts[:'redaction_period'].nil?
  form_params['SessionExpiration'] = opts[:'session_expiration'] if !opts[:'session_expiration'].nil?
  form_params['IsProductionUsage'] = opts[:'is_production_usage'] if !opts[:'is_production_usage'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateVerificationProfileResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"VerificationProfilesApi.create_verification_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VerificationProfilesApi#create_verification_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_verification_profile_by_id(id, opts = {}) ⇒ VerificationProfileResponse

Get Verification Profile Gets a specific verification profile by ID.

Parameters:

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

    the optional parameters

Returns:



145
146
147
148
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 145

def get_verification_profile_by_id(id, opts = {})
  data, _status_code, _headers = get_verification_profile_by_id_with_http_info(id, opts)
  data
end

#get_verification_profile_by_id_with_http_info(id, opts = {}) ⇒ Array<(VerificationProfileResponse, Integer, Hash)>

Get Verification Profile Gets a specific verification profile by ID.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(VerificationProfileResponse, Integer, Hash)>)

    VerificationProfileResponse data, response status code and response headers



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 155

def get_verification_profile_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VerificationProfilesApi.get_verification_profile_by_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VerificationProfilesApi.get_verification_profile_by_id"
  end
  # resource path
  local_var_path = '/api/valpha/verification-profiles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VerificationProfileResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"VerificationProfilesApi.get_verification_profile_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VerificationProfilesApi#get_verification_profile_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_verification_profiles(opts = {}) ⇒ ListVerificationProfilesResponse

List Verification Profiles List the verification profiles for the current organization and environment.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :page_size (Integer)

    Size of the list to be returned. Accepted range from 1 to 100 (default to 20)

Returns:



209
210
211
212
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 209

def list_verification_profiles(opts = {})
  data, _status_code, _headers = list_verification_profiles_with_http_info(opts)
  data
end

#list_verification_profiles_with_http_info(opts = {}) ⇒ Array<(ListVerificationProfilesResponse, Integer, Hash)>

List Verification Profiles List the verification profiles for the current organization and environment.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer) — default: default to 1
  • :page_size (Integer)

    Size of the list to be returned. Accepted range from 1 to 100 (default to 20)

Returns:



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/trinsic_api/api/verification_profiles_api.rb', line 220

def list_verification_profiles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VerificationProfilesApi.list_verification_profiles ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 2147483647
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VerificationProfilesApi.list_verification_profiles, must be smaller than or equal to 2147483647.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VerificationProfilesApi.list_verification_profiles, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VerificationProfilesApi.list_verification_profiles, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VerificationProfilesApi.list_verification_profiles, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/valpha/verification-profiles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/problem+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListVerificationProfilesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"VerificationProfilesApi.list_verification_profiles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VerificationProfilesApi#list_verification_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end