Class: LaunchDarklyApi::AccountMembersApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountMembersApi

Returns a new instance of AccountMembersApi.



19
20
21
# File 'lib/launchdarkly_api/api/account_members_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/launchdarkly_api/api/account_members_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_member(id, opts = {}) ⇒ nil

Delete account member Delete a single account member by ID. Requests to delete account members will not work if SCIM is enabled for the account.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 27

def delete_member(id, opts = {})
  delete_member_with_http_info(id, opts)
  nil
end

#delete_member_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete account member Delete a single account member by ID. Requests to delete account members will not work if SCIM is enabled for the account.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



37
38
39
40
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
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 37

def delete_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.delete_member ...'
  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 AccountMembersApi.delete_member"
  end
  # resource path
  local_var_path = '/api/v2/members/{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(['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]

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

  new_options = opts.merge(
    :operation => :"AccountMembersApi.delete_member",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountMembersApi#delete_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_member(id, opts = {}) ⇒ Member

Get account member Get a single account member by member ID. me is a reserved value for the id parameter that returns the caller's member information. ### Expanding the member response LaunchDarkly supports the following fields for expanding the "Get member" response. By default, these fields are not included in the response. To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields: * customRoles includes details on each custom role assigned to the member, including the role key, name, and ID. * roleAttributes includes a list of the role attributes that you have assigned to the member. For example, expand=customRoles,roleAttributes includes both the customRolesInfo and roleAttributes fields in the response.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Options Hash (opts):

  • :expand (String)

    A comma-separated list of properties that can reveal additional information in the response.

Returns:



91
92
93
94
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 91

def get_member(id, opts = {})
  data, _status_code, _headers = get_member_with_http_info(id, opts)
  data
end

#get_member_with_http_info(id, opts = {}) ⇒ Array<(Member, Integer, Hash)>

Get account member Get a single account member by member ID. `me` is a reserved value for the `id` parameter that returns the caller's member information. ### Expanding the member response LaunchDarkly supports the following fields for expanding the &quot;Get member&quot; response. By default, these fields are not included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `customRoles` includes details on each custom role assigned to the member, including the role key, name, and ID. * `roleAttributes` includes a list of the role attributes that you have assigned to the member. For example, `expand=customRoles,roleAttributes` includes both the `customRolesInfo` and `roleAttributes` fields in the response.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Options Hash (opts):

  • :expand (String)

    A comma-separated list of properties that can reveal additional information in the response.

Returns:

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

    Member data, response status code and response headers



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
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 102

def get_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.get_member ...'
  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 AccountMembersApi.get_member"
  end
  # resource path
  local_var_path = '/api/v2/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].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] || 'Member'

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

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

#get_members(opts = {}) ⇒ Members

List account members Return a list of account members. By default, this returns the first 20 members. Page through this list with the limit parameter and by following the first, prev, next, and last links in the returned _links field. These links are not present if the pages they refer to don't exist. For example, the first and prev links will be missing from the response on the first page. ### Filtering members LaunchDarkly supports the following fields for filters: - query is a string that matches against the members' emails and names. It is not case sensitive. - role is a | separated list of roles and custom roles. It filters the list to members who have any of the roles in the list. For the purposes of this filtering, Owner counts as Admin. - id is a | separated list of member IDs. It filters the list to members who match any of the IDs in the list. - email is a | separated list of member emails. It filters the list to members who match any of the emails in the list. - team is a string that matches against the key of the teams the members belong to. It is not case sensitive. - noteam is a boolean that filters the list of members who are not on a team if true and members on a team if false. - lastSeen is a JSON object in one of the following formats: - {\"never\": true} - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - {\"noData\": true} - Members that have not been active since LaunchDarkly began recording last seen timestamps. - {\"before\": 1608672063611} - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - accessCheck is a string that represents a specific action on a specific resource and is in the format <ActionSpecifier>:<ResourceSpecifier>. It filters the list to members who have the ability to perform that action on that resource. Note: accessCheck is only supported in API version 20220603 and earlier. To learn more, read Versioning. - For example, the filter accessCheck:createApprovalRequest:proj/default:env/test:flag/alternate-page matches members with the ability to create an approval request for the alternate-page flag in the test environment of the default project. - Wildcard and tag filters are not supported when filtering for access. For example, the filter query:abc,role:admin|customrole matches members with the string abc in their email or name, ignoring case, who also are either an Owner or Admin or have the custom role customrole. ### Sorting members LaunchDarkly supports two fields for sorting: displayName and lastSeen: - displayName sorts by first + last name, using the member's email if no name is set. - lastSeen sorts by the _lastSeen property. LaunchDarkly considers members that have never been seen or have no data the oldest. ### Expanding the members response LaunchDarkly supports two fields for expanding the "List members" response. By default, these fields are not included in the response. To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields: * customRoles includes a list of the roles that you have assigned to the member. * roleAttributes includes a list of the role attributes that you have assigned to the member. For example, expand=roleAttributes includes roleAttributes field in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of members to return in the response. Defaults to 20.

  • :offset (Integer)

    Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.

  • :expand (String)

    A comma-separated list of properties that can reveal additional information in the response.

  • :sort (String)

    A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.

Returns:



160
161
162
163
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 160

def get_members(opts = {})
  data, _status_code, _headers = get_members_with_http_info(opts)
  data
end

#get_members_with_http_info(opts = {}) ⇒ Array<(Members, Integer, Hash)>

List account members Return a list of account members. By default, this returns the first 20 members. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links are not present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page. ### Filtering members LaunchDarkly supports the following fields for filters: - `query` is a string that matches against the members' emails and names. It is not case sensitive. - `role` is a `|` separated list of roles and custom roles. It filters the list to members who have any of the roles in the list. For the purposes of this filtering, `Owner` counts as `Admin`. - `id` is a `|` separated list of member IDs. It filters the list to members who match any of the IDs in the list. - `email` is a `|` separated list of member emails. It filters the list to members who match any of the emails in the list. - `team` is a string that matches against the key of the teams the members belong to. It is not case sensitive. - `noteam` is a boolean that filters the list of members who are not on a team if true and members on a team if false. - `lastSeen` is a JSON object in one of the following formats: - `true` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - `true` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `1608672063611` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - `accessCheck` is a string that represents a specific action on a specific resource and is in the format `<ActionSpecifier>:<ResourceSpecifier>`. It filters the list to members who have the ability to perform that action on that resource. Note: `accessCheck` is only supported in API version `20220603` and earlier. To learn more, read Versioning. - For example, the filter `accessCheck:createApprovalRequest:proj/default:env/test:flag/alternate-page` matches members with the ability to create an approval request for the `alternate-page` flag in the `test` environment of the `default` project. - Wildcard and tag filters are not supported when filtering for access. For example, the filter `query:abc,role:admin|customrole` matches members with the string `abc` in their email or name, ignoring case, who also are either an `Owner` or `Admin` or have the custom role `customrole`. ### Sorting members LaunchDarkly supports two fields for sorting: `displayName` and `lastSeen`: - `displayName` sorts by first + last name, using the member's email if no name is set. - `lastSeen` sorts by the `_lastSeen` property. LaunchDarkly considers members that have never been seen or have no data the oldest. ### Expanding the members response LaunchDarkly supports two fields for expanding the &quot;List members&quot; response. By default, these fields are not included in the response. To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields: * `customRoles` includes a list of the roles that you have assigned to the member. * `roleAttributes` includes a list of the role attributes that you have assigned to the member. For example, `expand=roleAttributes` includes `roleAttributes` field in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of members to return in the response. Defaults to 20.

  • :offset (Integer)

    Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.

  • :filter (String)

    A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.

  • :expand (String)

    A comma-separated list of properties that can reveal additional information in the response.

  • :sort (String)

    A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.

Returns:

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

    Members data, response status code and response headers



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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 174

def get_members_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.get_members ...'
  end
  # resource path
  local_var_path = '/api/v2/members'

  # 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[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'Members'

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

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

#patch_member(id, patch_operation, opts = {}) ⇒ Member

Modify an account member Update a single account member. Updating a member uses a JSON patch representation of the desired changes. To learn more, read Updates. To update fields in the account member object that are arrays, set the path to the name of the field and then append /<array index>. Use /0 to add to the beginning of the array. Use /- to add to the end of the array. For example, to add a new custom role to a member, use the following request body: [ { \"op\": \"add\", \"path\": \"/customRoles/0\", \"value\": \"some-role-id\" } ] You can update only an account member's role or custom role using a JSON patch. Members can update their own names and email addresses though the LaunchDarkly UI. When SAML SSO or SCIM is enabled for the account, account members are managed in the Identity Provider (IdP). Requests to update account members will succeed, but the IdP will override the update shortly afterwards.

Parameters:

  • id (String)

    The member ID

  • patch_operation (Array<PatchOperation>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



229
230
231
232
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 229

def patch_member(id, patch_operation, opts = {})
  data, _status_code, _headers = patch_member_with_http_info(id, patch_operation, opts)
  data
end

#patch_member_with_http_info(id, patch_operation, opts = {}) ⇒ Array<(Member, Integer, Hash)>

Modify an account member Update a single account member. Updating a member uses a JSON patch representation of the desired changes. To learn more, read Updates. To update fields in the account member object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array. For example, to add a new custom role to a member, use the following request body: ``` [ { &quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/customRoles/0&quot;, &quot;value&quot;: &quot;some-role-id&quot; } ] ``` You can update only an account member's role or custom role using a JSON patch. Members can update their own names and email addresses though the LaunchDarkly UI. When SAML SSO or SCIM is enabled for the account, account members are managed in the Identity Provider (IdP). Requests to update account members will succeed, but the IdP will override the update shortly afterwards.

Parameters:

  • id (String)

    The member ID

  • patch_operation (Array<PatchOperation>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Member data, response status code and response headers



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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 240

def patch_member_with_http_info(id, patch_operation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.patch_member ...'
  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 AccountMembersApi.patch_member"
  end
  # verify the required parameter 'patch_operation' is set
  if @api_client.config.client_side_validation && patch_operation.nil?
    fail ArgumentError, "Missing the required parameter 'patch_operation' when calling AccountMembersApi.patch_member"
  end
  # resource path
  local_var_path = '/api/v2/members/{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(['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(patch_operation)

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

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

  new_options = opts.merge(
    :operation => :"AccountMembersApi.patch_member",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountMembersApi#patch_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_members(members_patch_input, opts = {}) ⇒ BulkEditMembersRep

Modify account members

Full use of this API resource is an Enterprise feature > > The ability to perform a partial update to multiple members is available to customers on an Enterprise plan. If you are on another plan, you can update members individually. To learn more, read about our pricing. To upgrade your plan, contact Sales. Perform a partial update to multiple members. Updating members uses the semantic patch format. To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch. ### Instructions Semantic patch requests support the following kind instructions for updating members.
Click to expand instructions for updating members #### replaceMembersRoles Replaces the roles of the specified members. This also removes all custom roles assigned to the specified members. ##### Parameters - value: The new role. Must be a valid base role. To learn more, read Roles. - memberIDs: List of member IDs. Here's an example: json { \"instructions\": [{ \"kind\": \"replaceMembersRoles\", \"value\": \"reader\", \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ] }] } #### replaceAllMembersRoles Replaces the roles of all members. This also removes all custom roles assigned to the specified members. Members that match any of the filters are excluded from the update. ##### Parameters - value: The new role. Must be a valid base role. To learn more, read Roles. - filterLastSeen: (Optional) A JSON object with one of the following formats: - {\"never\": true} - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - {\"noData\": true} - Members that have not been active since LaunchDarkly began recording last seen timestamps. - {\"before\": 1608672063611} - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - filterQuery: (Optional) A string that matches against the members' emails and names. It is not case sensitive. - filterRoles: (Optional) A | separated list of roles and custom roles. For the purposes of this filtering, Owner counts as Admin. - filterTeamKey: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive. - ignoredMemberIDs: (Optional) A list of member IDs. Here's an example: json { \"instructions\": [{ \"kind\": \"replaceAllMembersRoles\", \"value\": \"reader\", \"filterLastSeen\": { \"never\": true } }] } #### replaceMembersCustomRoles Replaces the custom roles of the specified members. ##### Parameters - values: List of new custom roles. Must be a valid custom role key or ID. - memberIDs: List of member IDs. Here's an example: json { \"instructions\": [{ \"kind\": \"replaceMembersCustomRoles\", \"values\": [ \"example-custom-role\" ], \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ] }] } #### replaceAllMembersCustomRoles Replaces the custom roles of all members. Members that match any of the filters are excluded from the update. ##### Parameters - values: List of new roles. Must be a valid custom role key or ID. - filterLastSeen: (Optional) A JSON object with one of the following formats: - {\"never\": true} - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - {\"noData\": true} - Members that have not been active since LaunchDarkly began recording last seen timestamps. - {\"before\": 1608672063611} - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - filterQuery: (Optional) A string that matches against the members' emails and names. It is not case sensitive. - filterRoles: (Optional) A | separated list of roles and custom roles. For the purposes of this filtering, Owner counts as Admin. - filterTeamKey: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive. - ignoredMemberIDs: (Optional) A list of member IDs. Here's an example: json { \"instructions\": [{ \"kind\": \"replaceAllMembersCustomRoles\", \"values\": [ \"example-custom-role\" ], \"filterLastSeen\": { \"never\": true } }] } #### replaceMembersRoleAttributes Replaces the role attributes of the specified members. ##### Parameters - value: Map of role attribute keys to lists of values. - memberIDs: List of member IDs. Here's an example: json { \"instructions\": [{ \"kind\": \"replaceMembersRoleAttributes\", \"value\": { \"myRoleProjectKey\": [\"mobile\", \"web\"], \"myRoleEnvironmentKey\": [\"production\"] }, \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ] }] }

Parameters:

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

    the optional parameters

Returns:



302
303
304
305
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 302

def patch_members(members_patch_input, opts = {})
  data, _status_code, _headers = patch_members_with_http_info(members_patch_input, opts)
  data
end

#patch_members_with_http_info(members_patch_input, opts = {}) ⇒ Array<(BulkEditMembersRep, Integer, Hash)>

Modify account members > ### Full use of this API resource is an Enterprise feature > > The ability to perform a partial update to multiple members is available to customers on an Enterprise plan. If you are on another plan, you can update members individually. To learn more, read about our pricing. To upgrade your plan, contact Sales. Perform a partial update to multiple members. Updating members uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read Updates using semantic patch. ### Instructions Semantic patch requests support the following `kind` instructions for updating members. <details> <summary>Click to expand instructions for <strong>updating members</strong></summary> #### replaceMembersRoles Replaces the roles of the specified members. This also removes all custom roles assigned to the specified members. ##### Parameters - `value`: The new role. Must be a valid base role. To learn more, read Roles. - `memberIDs`: List of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMembersRoles&quot;, &quot;value&quot;: &quot;reader&quot;, &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` #### replaceAllMembersRoles Replaces the roles of all members. This also removes all custom roles assigned to the specified members. Members that match any of the filters are excluded from the update. ##### Parameters - `value`: The new role. Must be a valid base role. To learn more, read Roles. - `filterLastSeen`: (Optional) A JSON object with one of the following formats: - `true` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - `true` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `1608672063611` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive. - `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`. - `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive. - `ignoredMemberIDs`: (Optional) A list of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceAllMembersRoles&quot;, &quot;value&quot;: &quot;reader&quot;, &quot;filterLastSeen&quot;: { &quot;never&quot;: true } }] } ``` #### replaceMembersCustomRoles Replaces the custom roles of the specified members. ##### Parameters - `values`: List of new custom roles. Must be a valid custom role key or ID. - `memberIDs`: List of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMembersCustomRoles&quot;, &quot;values&quot;: [ &quot;example-custom-role&quot; ], &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` #### replaceAllMembersCustomRoles Replaces the custom roles of all members. Members that match any of the filters are excluded from the update. ##### Parameters - `values`: List of new roles. Must be a valid custom role key or ID. - `filterLastSeen`: (Optional) A JSON object with one of the following formats: - `true` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM. - `true` - Members that have not been active since LaunchDarkly began recording last seen timestamps. - `1608672063611` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds. - `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive. - `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`. - `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive. - `ignoredMemberIDs`: (Optional) A list of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceAllMembersCustomRoles&quot;, &quot;values&quot;: [ &quot;example-custom-role&quot; ], &quot;filterLastSeen&quot;: { &quot;never&quot;: true } }] } ``` #### replaceMembersRoleAttributes Replaces the role attributes of the specified members. ##### Parameters - `value`: Map of role attribute keys to lists of values. - `memberIDs`: List of member IDs. Here's an example: ```json { &quot;instructions&quot;: [{ &quot;kind&quot;: &quot;replaceMembersRoleAttributes&quot;, &quot;value&quot;: { &quot;myRoleProjectKey&quot;: [&quot;mobile&quot;, &quot;web&quot;], &quot;myRoleEnvironmentKey&quot;: [&quot;production&quot;] }, &quot;memberIDs&quot;: [ &quot;1234a56b7c89d012345e678f&quot;, &quot;507f1f77bcf86cd799439011&quot; ] }] } ``` </details>

Parameters:

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

    the optional parameters

Returns:

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

    BulkEditMembersRep data, response status code and response headers



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 312

def patch_members_with_http_info(members_patch_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.patch_members ...'
  end
  # verify the required parameter 'members_patch_input' is set
  if @api_client.config.client_side_validation && members_patch_input.nil?
    fail ArgumentError, "Missing the required parameter 'members_patch_input' when calling AccountMembersApi.patch_members"
  end
  # resource path
  local_var_path = '/api/v2/members'

  # 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(members_patch_input)

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

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

  new_options = opts.merge(
    :operation => :"AccountMembersApi.patch_members",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountMembersApi#patch_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_member_teams(id, member_teams_post_input, opts = {}) ⇒ Member

Add a member to teams Add one member to one or more teams.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Returns:



371
372
373
374
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 371

def post_member_teams(id, member_teams_post_input, opts = {})
  data, _status_code, _headers = post_member_teams_with_http_info(id, member_teams_post_input, opts)
  data
end

#post_member_teams_with_http_info(id, member_teams_post_input, opts = {}) ⇒ Array<(Member, Integer, Hash)>

Add a member to teams Add one member to one or more teams.

Parameters:

  • id (String)

    The member ID

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

    the optional parameters

Returns:

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

    Member data, response status code and response headers



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 382

def post_member_teams_with_http_info(id, member_teams_post_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.post_member_teams ...'
  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 AccountMembersApi.post_member_teams"
  end
  # verify the required parameter 'member_teams_post_input' is set
  if @api_client.config.client_side_validation && member_teams_post_input.nil?
    fail ArgumentError, "Missing the required parameter 'member_teams_post_input' when calling AccountMembersApi.post_member_teams"
  end
  # resource path
  local_var_path = '/api/v2/members/{id}/teams'.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(['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(member_teams_post_input)

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

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

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

#post_members(new_member_form, opts = {}) ⇒ Members

Invite new members Invite one or more new members to join an account. Each member is sent an invitation. Members with Admin or Owner roles may create new members, as well as anyone with a createMember permission for "member/\*". If a member cannot be invited, the entire request is rejected and no members are invited from that request. Each member must have an email field and either a role or a customRoles field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the "message" field of the response. Valid base role names that you can provide for the role field include reader, writer, admin, owner/admin, and no_access. To learn more about base roles, read Organization roles. If you are using the customRoles field instead, you can provide the key for any role that you have created, or for any preset organization role or project role provided by LaunchDarkly. Some preset roles additionally require that you specify roleAttributes. To learn more, read Using role scope. Requests to create account members will not work if SCIM is enabled for the account. No more than 50 members may be created per request. A request may also fail because of conflicts with existing members. These conflicts are reported using the additional code and invalid_emails response fields with the following possible values for code: - email_already_exists_in_account: A member with this email address already exists in this account. - email_taken_in_different_account: A member with this email address exists in another account. - duplicate_emails: This request contains two or more members with the same email address. A request that fails for one of the above reasons returns an HTTP response code of 400 (Bad Request).

Parameters:

  • new_member_form (Array<NewMemberForm>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



444
445
446
447
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 444

def post_members(new_member_form, opts = {})
  data, _status_code, _headers = post_members_with_http_info(new_member_form, opts)
  data
end

#post_members_with_http_info(new_member_form, opts = {}) ⇒ Array<(Members, Integer, Hash)>

Invite new members Invite one or more new members to join an account. Each member is sent an invitation. Members with Admin or Owner roles may create new members, as well as anyone with a `createMember` permission for &quot;member/\*&quot;. If a member cannot be invited, the entire request is rejected and no members are invited from that request. Each member must have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the &quot;message&quot; field of the response. Valid base role names that you can provide for the `role` field include `reader`, `writer`, `admin`, `owner/admin`, and `no_access`. To learn more about base roles, read Organization roles. If you are using the `customRoles` field instead, you can provide the key for any role that you have created, or for any preset organization role or project role provided by LaunchDarkly. Some preset roles additionally require that you specify `roleAttributes`. To learn more, read Using role scope. Requests to create account members will not work if SCIM is enabled for the account. No more than 50 members may be created per request. A request may also fail because of conflicts with existing members. These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`: - email_already_exists_in_account: A member with this email address already exists in this account. - email_taken_in_different_account: A member with this email address exists in another account. - duplicate_emails: This request contains two or more members with the same email address. A request that fails for one of the above reasons returns an HTTP response code of 400 (Bad Request).

Parameters:

  • new_member_form (Array<NewMemberForm>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Members data, response status code and response headers



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
# File 'lib/launchdarkly_api/api/account_members_api.rb', line 454

def post_members_with_http_info(new_member_form, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountMembersApi.post_members ...'
  end
  # verify the required parameter 'new_member_form' is set
  if @api_client.config.client_side_validation && new_member_form.nil?
    fail ArgumentError, "Missing the required parameter 'new_member_form' when calling AccountMembersApi.post_members"
  end
  # resource path
  local_var_path = '/api/v2/members'

  # 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(new_member_form)

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

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

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