Class: ClerkHttpClient::OrganizationInvitationsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/clerk-http-client/api/organization_invitations_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrganizationInvitationsApi

Returns a new instance of OrganizationInvitationsApi.



19
20
21
# File 'lib/clerk-http-client/api/organization_invitations_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/clerk-http-client/api/organization_invitations_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#all(organization_id, opts = {}) ⇒ OrganizationInvitations

Get a list of organization invitations This request returns the list of organization invitations. Results can be paginated using the optional ‘limit` and `offset` query parameters. You can filter them by providing the ’status’ query parameter, that accepts multiple values. The organization invitations are ordered by descending creation date. Most recent invitations will be returned first. Any invitations created as a result of an Organization Domain are not included in the results.

Parameters:

  • organization_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. (default to 10)

  • :offset (Float)

    Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. (default to 0)

  • :status (String)

    Filter organization invitations based on their status

Returns:



255
256
257
258
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 255

def all(opts = {})
  data, _status_code, _headers = all_with_http_info(opts)
  data
end

#all_with_http_info(organization_id, opts = {}) ⇒ Array<(OrganizationInvitations, Integer, Hash)>

Get a list of organization invitations This request returns the list of organization invitations. Results can be paginated using the optional &#x60;limit&#x60; and &#x60;offset&#x60; query parameters. You can filter them by providing the &#39;status&#39; query parameter, that accepts multiple values. The organization invitations are ordered by descending creation date. Most recent invitations will be returned first. Any invitations created as a result of an Organization Domain are not included in the results. GET

Parameters:

  • organization_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

  • :status (String)

    Filter organization invitations based on their status

Returns:

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

    OrganizationInvitations data, response status code and response headers



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 270

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

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

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

  allowable_values = ["pending", "accepted", "revoked"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/organization_invitations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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] || 'OrganizationInvitationsWithPublicOrganizationData'

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.list_instance_organization_invitations",
    :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: OrganizationInvitationsApi#list_instance_organization_invitations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create(organization_id, create_organization_invitation_request, opts = {}) ⇒ OrganizationInvitation

Create and send an organization invitation Creates a new organization invitation and sends an email to the provided ‘email_address` with a link to accept the invitation and join the organization. You can specify the `role` for the invited organization member. New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. The request body supports passing an optional `redirect_url` parameter. When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. Use this parameter to implement a custom invitation acceptance flow. You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. That user must be a member with administrator privileges in the organization. Only "admin" members can create organization invitations. You can optionally provide public and private metadata for the organization invitation. The public metadata are visible by both the Frontend and the Backend whereas the private ones only by the Backend. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership.

Parameters:

  • organization_id (String)

    The ID of the organization for which to send the invitation

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 29

def create(organization_id, create_organization_invitation_request, opts = {})
  data, _status_code, _headers = create_with_http_info(organization_id, create_organization_invitation_request, opts)
  data
end

#create_bulk(organization_id, create_organization_invitation_bulk_request_inner, opts = {}) ⇒ OrganizationInvitations

Bulk create and send organization invitations Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. You can specify a different ‘role` for each invited organization member. New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. The request body supports passing an optional `redirect_url` parameter for each invitation. When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. Use this parameter to implement a custom invitation acceptance flow. You can specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. Each invitation can have a different inviter user. Inviter users must be members with administrator privileges in the organization. Only "admin" members can create organization invitations. You can optionally provide public and private metadata for each organization invitation. The public metadata are visible by both the Frontend and the Backend, whereas the private metadata are only visible by the Backend. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership.

Parameters:

Returns:



105
106
107
108
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 105

def create_bulk(organization_id, create_organization_invitation_bulk_request_inner, opts = {})
  data, _status_code, _headers = create_bulk_with_http_info(organization_id, create_organization_invitation_bulk_request_inner, opts)
  data
end

#create_bulk_with_http_info(organization_id, create_organization_invitation_bulk_request_inner, opts = {}) ⇒ Array<(OrganizationInvitations, Integer, Hash)>

Bulk create and send organization invitations Creates new organization invitations in bulk and sends out emails to the provided email addresses with a link to accept the invitation and join the organization. You can specify a different &#x60;role&#x60; for each invited organization member. New organization invitations get a &quot;pending&quot; status until they are revoked by an organization administrator or accepted by the invitee. The request body supports passing an optional &#x60;redirect_url&#x60; parameter for each invitation. When the invited user clicks the link to accept the invitation, they will be redirected to the provided URL. Use this parameter to implement a custom invitation acceptance flow. You can specify the ID of the user that will send the invitation with the &#x60;inviter_user_id&#x60; parameter. Each invitation can have a different inviter user. Inviter users must be members with administrator privileges in the organization. Only &quot;admin&quot; members can create organization invitations. You can optionally provide public and private metadata for each organization invitation. The public metadata are visible by both the Frontend and the Backend, whereas the private metadata are only visible by the Backend. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. POST

Parameters:

Returns:

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

    OrganizationInvitations data, response status code and response headers



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 117

def create_bulk_with_http_info(organization_id, create_organization_invitation_bulk_request_inner, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationInvitationsApi.create_organization_invitation_bulk ...'
  end
  # verify the required parameter 'organization_id' is set
  if @api_client.config.client_side_validation && organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationInvitationsApi.create_organization_invitation_bulk"
  end
  # verify the required parameter 'create_organization_invitation_bulk_request_inner' is set
  if @api_client.config.client_side_validation && create_organization_invitation_bulk_request_inner.nil?
    fail ArgumentError, "Missing the required parameter 'create_organization_invitation_bulk_request_inner' when calling OrganizationInvitationsApi.create_organization_invitation_bulk"
  end
  # resource path
  local_var_path = '/organizations/{organization_id}/invitations/bulk'.sub('{' + 'organization_id' + '}', CGI.escape(organization_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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_invitation_bulk_request_inner)

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

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.create_organization_invitation_bulk",
    :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: OrganizationInvitationsApi#create_organization_invitation_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_with_http_info(organization_id, create_organization_invitation_request, opts = {}) ⇒ Array<(OrganizationInvitation, Integer, Hash)>

Create and send an organization invitation Creates a new organization invitation and sends an email to the provided &#x60;email_address&#x60; with a link to accept the invitation and join the organization. You can specify the &#x60;role&#x60; for the invited organization member. New organization invitations get a &quot;pending&quot; status until they are revoked by an organization administrator or accepted by the invitee. The request body supports passing an optional &#x60;redirect_url&#x60; parameter. When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. Use this parameter to implement a custom invitation acceptance flow. You can specify the ID of the user that will send the invitation with the &#x60;inviter_user_id&#x60; parameter. That user must be a member with administrator privileges in the organization. Only &quot;admin&quot; members can create organization invitations. You can optionally provide public and private metadata for the organization invitation. The public metadata are visible by both the Frontend and the Backend whereas the private ones only by the Backend. When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. POST

Parameters:

  • organization_id (String)

    The ID of the organization for which to send the invitation

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

    the optional parameters

Returns:

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

    OrganizationInvitation data, response status code and response headers



41
42
43
44
45
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
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 41

def create_with_http_info(organization_id, create_organization_invitation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationInvitationsApi.create_organization_invitation ...'
  end
  # verify the required parameter 'organization_id' is set
  if @api_client.config.client_side_validation && organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationInvitationsApi.create_organization_invitation"
  end
  # verify the required parameter 'create_organization_invitation_request' is set
  if @api_client.config.client_side_validation && create_organization_invitation_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_organization_invitation_request' when calling OrganizationInvitationsApi.create_organization_invitation"
  end
  # resource path
  local_var_path = '/organizations/{organization_id}/invitations'.sub('{' + 'organization_id' + '}', CGI.escape(organization_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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_invitation_request)

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

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.create_organization_invitation",
    :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: OrganizationInvitationsApi#create_organization_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#find(organization_id, invitation_id, opts = {}) ⇒ OrganizationInvitation

Retrieve an organization invitation by ID Use this request to get an existing organization invitation by ID.

Parameters:

  • organization_id (String)

    The organization ID.

  • invitation_id (String)

    The organization invitation ID.

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

    the optional parameters

Returns:



181
182
183
184
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 181

def find(organization_id, invitation_id, opts = {})
  data, _status_code, _headers = find_with_http_info(organization_id, invitation_id, opts)
  data
end

#find_with_http_info(organization_id, invitation_id, opts = {}) ⇒ Array<(OrganizationInvitation, Integer, Hash)>

Retrieve an organization invitation by ID Use this request to get an existing organization invitation by ID. GET

Parameters:

  • organization_id (String)

    The organization ID.

  • invitation_id (String)

    The organization invitation ID.

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

    the optional parameters

Returns:

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

    OrganizationInvitation data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 193

def find_with_http_info(organization_id, invitation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationInvitationsApi.get_organization_invitation ...'
  end
  # verify the required parameter 'organization_id' is set
  if @api_client.config.client_side_validation && organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationInvitationsApi.get_organization_invitation"
  end
  # verify the required parameter 'invitation_id' is set
  if @api_client.config.client_side_validation && invitation_id.nil?
    fail ArgumentError, "Missing the required parameter 'invitation_id' when calling OrganizationInvitationsApi.get_organization_invitation"
  end
  # resource path
  local_var_path = '/organizations/{organization_id}/invitations/{invitation_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s)).sub('{' + 'invitation_id' + '}', CGI.escape(invitation_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(['application/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] || 'OrganizationInvitation'

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.get_organization_invitation",
    :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: OrganizationInvitationsApi#get_organization_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pending(organization_id, opts = {}) ⇒ OrganizationInvitations

Get a list of pending organization invitations This request returns the list of organization invitations with "pending" status. These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. Results can be paginated using the optional ‘limit` and `offset` query parameters. The organization invitations are ordered by descending creation date. Most recent invitations will be returned first. Any invitations created as a result of an Organization Domain are not included in the results.

Parameters:

  • organization_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

Returns:



433
434
435
436
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 433

def pending(organization_id, opts = {})
  data, _status_code, _headers = pending_with_http_info(organization_id, opts)
  data
end

#pending_with_http_info(organization_id, opts = {}) ⇒ Array<(OrganizationInvitations, Integer, Hash)>

Get a list of pending organization invitations This request returns the list of organization invitations with &quot;pending&quot; status. These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. Results can be paginated using the optional &#x60;limit&#x60; and &#x60;offset&#x60; query parameters. The organization invitations are ordered by descending creation date. Most recent invitations will be returned first. Any invitations created as a result of an Organization Domain are not included in the results. GET

Parameters:

  • organization_id (String)

    The organization ID.

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

Returns:

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

    OrganizationInvitations data, response status code and response headers



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 446

def pending_with_http_info(organization_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationInvitationsApi.list_pending_organization_invitations ...'
  end
  # verify the required parameter 'organization_id' is set
  if @api_client.config.client_side_validation && organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationInvitationsApi.list_pending_organization_invitations"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationInvitationsApi.list_pending_organization_invitations, must be smaller than or equal to 500.'
  end

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

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

  # resource path
  local_var_path = '/organizations/{organization_id}/invitations/pending'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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] || 'OrganizationInvitations'

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.list_pending_organization_invitations",
    :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: OrganizationInvitationsApi#list_pending_organization_invitations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke(organization_id, invitation_id, opts = {}) ⇒ OrganizationInvitation

Revoke a pending organization invitation Use this request to revoke a previously issued organization invitation. Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. Only organization invitations with "pending" status can be revoked. The request accepts the ‘requesting_user_id` parameter to specify the user which revokes the invitation. Only users with "admin" role can revoke invitations.

Parameters:

  • organization_id (String)

    The organization ID.

  • invitation_id (String)

    The organization invitation ID.

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

    the optional parameters

Options Hash (opts):

Returns:



516
517
518
519
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 516

def revoke(organization_id, invitation_id, opts = {})
  data, _status_code, _headers = revoke_with_http_info(organization_id, invitation_id, opts)
  data
end

#revoke_with_http_info(organization_id, invitation_id, opts = {}) ⇒ Array<(OrganizationInvitation, Integer, Hash)>

Revoke a pending organization invitation Use this request to revoke a previously issued organization invitation. Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. Only organization invitations with &quot;pending&quot; status can be revoked. The request accepts the &#x60;requesting_user_id&#x60; parameter to specify the user which revokes the invitation. Only users with &quot;admin&quot; role can revoke invitations. POST

Parameters:

  • organization_id (String)

    The organization ID.

  • invitation_id (String)

    The organization invitation ID.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    OrganizationInvitation data, response status code and response headers



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/clerk-http-client/api/organization_invitations_api.rb', line 529

def revoke_with_http_info(organization_id, invitation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationInvitationsApi.revoke_organization_invitation ...'
  end
  # verify the required parameter 'organization_id' is set
  if @api_client.config.client_side_validation && organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationInvitationsApi.revoke_organization_invitation"
  end
  # verify the required parameter 'invitation_id' is set
  if @api_client.config.client_side_validation && invitation_id.nil?
    fail ArgumentError, "Missing the required parameter 'invitation_id' when calling OrganizationInvitationsApi.revoke_organization_invitation"
  end
  # resource path
  local_var_path = '/organizations/{organization_id}/invitations/{invitation_id}/revoke'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s)).sub('{' + 'invitation_id' + '}', CGI.escape(invitation_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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'revoke_organization_invitation_request'])

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

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

  new_options = opts.merge(
    :operation => :"OrganizationInvitationsApi.revoke_organization_invitation",
    :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: OrganizationInvitationsApi#revoke_organization_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end