Class: LaunchDarklyApi::TeamsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TeamsApi

Returns a new instance of TeamsApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_team(team_key, opts = {}) ⇒ nil

Delete team Delete a team by key. To learn more, read [Deleting a team](docs.launchdarkly.com/home/teams/managing#deleting-a-team).

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Returns:

  • (nil)


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

def delete_team(team_key, opts = {})
  delete_team_with_http_info(team_key, opts)
  nil
end

#delete_team_with_http_info(team_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete team Delete a team by key. To learn more, read [Deleting a team](docs.launchdarkly.com/home/teams/managing#deleting-a-team).

Parameters:

  • team_key (String)

    The team key

  • 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/teams_api.rb', line 37

def delete_team_with_http_info(team_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.delete_team ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.delete_team"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])

  # 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 => :"TeamsApi.delete_team",
    :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: TeamsApi#delete_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_team(team_key, opts = {}) ⇒ Team

Get team Fetch a team by key. ### Expanding the teams response LaunchDarkly supports four fields for expanding the "Get team" 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: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.

Parameters:

  • team_key (String)

    The team key.

  • 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/teams_api.rb', line 91

def get_team(team_key, opts = {})
  data, _status_code, _headers = get_team_with_http_info(team_key, opts)
  data
end

#get_team_maintainers(team_key, opts = {}) ⇒ TeamMaintainers

Get team maintainers Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of maintainers 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 &#x60;limit&#x60;.

Returns:



158
159
160
161
# File 'lib/launchdarkly_api/api/teams_api.rb', line 158

def get_team_maintainers(team_key, opts = {})
  data, _status_code, _headers = get_team_maintainers_with_http_info(team_key, opts)
  data
end

#get_team_maintainers_with_http_info(team_key, opts = {}) ⇒ Array<(TeamMaintainers, Integer, Hash)>

Get team maintainers Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of maintainers 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 &#x60;limit&#x60;.

Returns:

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

    TeamMaintainers data, response status code and response headers



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

def get_team_maintainers_with_http_info(team_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team_maintainers ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.get_team_maintainers"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}/maintainers'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])

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

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

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

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

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

#get_team_roles(team_key, opts = {}) ⇒ TeamCustomRoles

Get team custom roles Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](docs.launchdarkly.com/home/teams/managing#managing-team-permissions).

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of roles 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 &#x60;limit&#x60;.

Returns:



227
228
229
230
# File 'lib/launchdarkly_api/api/teams_api.rb', line 227

def get_team_roles(team_key, opts = {})
  data, _status_code, _headers = get_team_roles_with_http_info(team_key, opts)
  data
end

#get_team_roles_with_http_info(team_key, opts = {}) ⇒ Array<(TeamCustomRoles, Integer, Hash)>

Get team custom roles Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](docs.launchdarkly.com/home/teams/managing#managing-team-permissions).

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of roles 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 &#x60;limit&#x60;.

Returns:

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

    TeamCustomRoles data, response status code and response headers



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
281
282
283
284
285
286
287
# File 'lib/launchdarkly_api/api/teams_api.rb', line 239

def get_team_roles_with_http_info(team_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team_roles ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.get_team_roles"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}/roles'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])

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

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

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

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

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

#get_team_with_http_info(team_key, opts = {}) ⇒ Array<(Team, Integer, Hash)>

Get team Fetch a team by key. ### Expanding the teams response LaunchDarkly supports four fields for expanding the &quot;Get team&quot; response. By default, these fields are not included in the response. To expand the response, append the &#x60;expand&#x60; query parameter and add a comma-separated list with any of the following fields: * &#x60;members&#x60; includes the total count of members that belong to the team. * &#x60;roles&#x60; includes a paginated list of the custom roles that you have assigned to the team. * &#x60;projects&#x60; includes a paginated list of the projects that the team has any write access to. * &#x60;maintainers&#x60; includes a paginated list of the maintainers that you have assigned to the team. For example, &#x60;expand&#x3D;members,roles&#x60; includes the &#x60;members&#x60; and &#x60;roles&#x60; fields in the response.

Parameters:

  • team_key (String)

    The team key.

  • 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<(Team, Integer, Hash)>)

    Team 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/teams_api.rb', line 102

def get_team_with_http_info(team_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.get_team"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])

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

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

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

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

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

#get_teams(opts = {}) ⇒ Teams

List teams Return a list of teams. By default, this returns the first 20 teams. Page through this list with the ‘limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, 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, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering teams LaunchDarkly supports the following fields for filters: - `query` is a string that matches against the teams’ names and keys. It is not case-sensitive. - A request with ‘query:abc` returns teams with the string `abc` in their name or key. - `nomembers` is a boolean that filters the list of teams who have 0 members - A request with `nomembers:true` returns teams that have 0 members - A request with `nomembers:false` returns teams that have 1 or more members ### Expanding the teams response LaunchDarkly supports four fields for expanding the "List teams" 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: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

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

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next &#x60;limit&#x60; items.

  • :filter (String)

    A comma-separated list of filters. Each filter is constructed as &#x60;field:value&#x60;.

  • :expand (String)

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

Returns:



297
298
299
300
# File 'lib/launchdarkly_api/api/teams_api.rb', line 297

def get_teams(opts = {})
  data, _status_code, _headers = get_teams_with_http_info(opts)
  data
end

#get_teams_with_http_info(opts = {}) ⇒ Array<(Teams, Integer, Hash)>

List teams Return a list of teams. By default, this returns the first 20 teams. Page through this list with the &#x60;limit&#x60; parameter and by following the &#x60;first&#x60;, &#x60;prev&#x60;, &#x60;next&#x60;, and &#x60;last&#x60; links in the &#x60;_links&#x60; field that returns. If those links do not appear, the pages they refer to don&#39;t exist. For example, the &#x60;first&#x60; and &#x60;prev&#x60; links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering teams LaunchDarkly supports the following fields for filters: - &#x60;query&#x60; is a string that matches against the teams&#39; names and keys. It is not case-sensitive. - A request with &#x60;query:abc&#x60; returns teams with the string &#x60;abc&#x60; in their name or key. - &#x60;nomembers&#x60; is a boolean that filters the list of teams who have 0 members - A request with &#x60;nomembers:true&#x60; returns teams that have 0 members - A request with &#x60;nomembers:false&#x60; returns teams that have 1 or more members ### Expanding the teams response LaunchDarkly supports four fields for expanding the &quot;List teams&quot; response. By default, these fields are not included in the response. To expand the response, append the &#x60;expand&#x60; query parameter and add a comma-separated list with any of the following fields: * &#x60;members&#x60; includes the total count of members that belong to the team. * &#x60;roles&#x60; includes a paginated list of the custom roles that you have assigned to the team. * &#x60;projects&#x60; includes a paginated list of the projects that the team has any write access to. * &#x60;maintainers&#x60; includes a paginated list of the maintainers that you have assigned to the team. For example, &#x60;expand&#x3D;members,roles&#x60; includes the &#x60;members&#x60; and &#x60;roles&#x60; fields in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

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

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next &#x60;limit&#x60; items.

  • :filter (String)

    A comma-separated list of filters. Each filter is constructed as &#x60;field:value&#x60;.

  • :expand (String)

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

Returns:

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

    Teams data, response status code and response headers



310
311
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
# File 'lib/launchdarkly_api/api/teams_api.rb', line 310

def get_teams_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_teams ...'
  end
  # resource path
  local_var_path = '/api/v2/teams'

  # 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?

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

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

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

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

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

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

#patch_team(team_key, team_patch_input, opts = {}) ⇒ Team

Update team Perform a partial update to a team. Updating a team 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](/reference#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating teams. #### addCustomRoles Adds custom roles to the team. Team members will have these custom roles granted to them. ##### Parameters - `values`: List of custom role keys. #### removeCustomRoles Removes custom roles from the team. The app will no longer grant these custom roles to the team members. ##### Parameters - `values`: List of custom role keys. #### addMembers Adds members to the team. ##### Parameters - `values`: List of member IDs. #### removeMembers Removes members from the team. ##### Parameters - `values`: List of member IDs. #### addPermissionGrants Adds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The members do not have to be team members to have a permission grant for the team. ##### Parameters - `actionSet`: Name of the action set. - `actions`: List of actions. - `memberIDs`: List of member IDs. #### removePermissionGrants Removes permission grants from members for the team. The `actionSet` and `actions` must match an existing permission grant. ##### Parameters - `actionSet`: Name of the action set. - `actions`: List of actions. - `memberIDs`: List of member IDs. #### updateDescription Updates the description of the team. ##### Parameters - `value`: The new description. #### updateName Updates the name of the team. ##### Parameters - `value`: The new name. ### Expanding the teams response LaunchDarkly supports four fields for expanding the "Update team" 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: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.

Parameters:

  • team_key (String)

    The team key

  • team_patch_input (TeamPatchInput)
  • 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. Supported fields are explained above.

Returns:



365
366
367
368
# File 'lib/launchdarkly_api/api/teams_api.rb', line 365

def patch_team(team_key, team_patch_input, opts = {})
  data, _status_code, _headers = patch_team_with_http_info(team_key, team_patch_input, opts)
  data
end

#patch_team_with_http_info(team_key, team_patch_input, opts = {}) ⇒ Array<(Team, Integer, Hash)>

Update team Perform a partial update to a team. Updating a team uses the semantic patch format. To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following &#x60;kind&#x60; instructions for updating teams. #### addCustomRoles Adds custom roles to the team. Team members will have these custom roles granted to them. ##### Parameters - &#x60;values&#x60;: List of custom role keys. #### removeCustomRoles Removes custom roles from the team. The app will no longer grant these custom roles to the team members. ##### Parameters - &#x60;values&#x60;: List of custom role keys. #### addMembers Adds members to the team. ##### Parameters - &#x60;values&#x60;: List of member IDs. #### removeMembers Removes members from the team. ##### Parameters - &#x60;values&#x60;: List of member IDs. #### addPermissionGrants Adds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an &#x60;actionSet&#x60; or a list of &#x60;actions&#x60; but not both at the same time. The members do not have to be team members to have a permission grant for the team. ##### Parameters - &#x60;actionSet&#x60;: Name of the action set. - &#x60;actions&#x60;: List of actions. - &#x60;memberIDs&#x60;: List of member IDs. #### removePermissionGrants Removes permission grants from members for the team. The &#x60;actionSet&#x60; and &#x60;actions&#x60; must match an existing permission grant. ##### Parameters - &#x60;actionSet&#x60;: Name of the action set. - &#x60;actions&#x60;: List of actions. - &#x60;memberIDs&#x60;: List of member IDs. #### updateDescription Updates the description of the team. ##### Parameters - &#x60;value&#x60;: The new description. #### updateName Updates the name of the team. ##### Parameters - &#x60;value&#x60;: The new name. ### Expanding the teams response LaunchDarkly supports four fields for expanding the &quot;Update team&quot; response. By default, these fields are not included in the response. To expand the response, append the &#x60;expand&#x60; query parameter and add a comma-separated list with any of the following fields: * &#x60;members&#x60; includes the total count of members that belong to the team. * &#x60;roles&#x60; includes a paginated list of the custom roles that you have assigned to the team. * &#x60;projects&#x60; includes a paginated list of the projects that the team has any write access to. * &#x60;maintainers&#x60; includes a paginated list of the maintainers that you have assigned to the team. For example, &#x60;expand&#x3D;members,roles&#x60; includes the &#x60;members&#x60; and &#x60;roles&#x60; fields in the response.

Parameters:

  • team_key (String)

    The team key

  • team_patch_input (TeamPatchInput)
  • 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. Supported fields are explained above.

Returns:

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

    Team data, response status code and response headers



377
378
379
380
381
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
# File 'lib/launchdarkly_api/api/teams_api.rb', line 377

def patch_team_with_http_info(team_key, team_patch_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.patch_team ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.patch_team"
  end
  # verify the required parameter 'team_patch_input' is set
  if @api_client.config.client_side_validation && team_patch_input.nil?
    fail ArgumentError, "Missing the required parameter 'team_patch_input' when calling TeamsApi.patch_team"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])
  # 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(team_patch_input)

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

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

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

#post_team(team_post_input, opts = {}) ⇒ Team

Create team Create a team. To learn more, read [Creating a team](docs.launchdarkly.com/home/teams/creating). ### Expanding the teams response LaunchDarkly supports four fields for expanding the "Create team" 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: * `members` includes the total count of members that belong to the team. * `roles` includes a paginated list of the custom roles that you have assigned to the team. * `projects` includes a paginated list of the projects that the team has any write access to. * `maintainers` includes a paginated list of the maintainers that you have assigned to the team. For example, `expand=members,roles` includes the `members` and `roles` fields in the response.

Parameters:

  • team_post_input (TeamPostInput)
  • 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. Supported fields are explained above.

Returns:



441
442
443
444
# File 'lib/launchdarkly_api/api/teams_api.rb', line 441

def post_team(team_post_input, opts = {})
  data, _status_code, _headers = post_team_with_http_info(team_post_input, opts)
  data
end

#post_team_members(team_key, opts = {}) ⇒ TeamImportsRep

Add multiple members to team Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](docs.launchdarkly.com/home/teams/managing#managing-team-members). **Members are only added on a ‘201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries. A `207` results in no members being added to the team. On a `207` response, if an entry contains bad user input, the `message` field contains the row number as well as the reason for the error. The `message` field is omitted if the entry is valid. Example `207` response: “`json { "items": [ { "status": "success", "value": "[email protected]" }, { "message": "Line 2: empty row", "status": "error", "value": "" }, { "message": "Line 3: email already exists in the specified team", "status": "error", "value": "[email protected]" }, { "message": "Line 4: invalid email formatting", "status": "error", "value": "invalid email format" } ] } “` Message | Resolution — | — Empty row | This line is blank. Add an email address and try again. Duplicate entry | This email address appears in the file twice. Remove the email from the file and try again. Email already exists in the specified team | This member is already on your team. Remove the email from the file and try again. Invalid formatting | This email address is not formatted correctly. Fix the formatting and try again. Email does not belong to a LaunchDarkly member | The email address doesn’t belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team. On a ‘400` response, the `message` field may contain errors specific to this endpoint. Example `400` response: “`json { "code": "invalid_request", "message": "Unable to process file" } “` Message | Resolution — | — Unable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again. File exceeds 25mb | Break up your file into multiple files of less than 25mbs each. All emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again. All emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again. File is empty | The CSV file does not contain any email addresses. Populate the file and try again. No emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    CSV file containing email addresses

Returns:



512
513
514
515
# File 'lib/launchdarkly_api/api/teams_api.rb', line 512

def post_team_members(team_key, opts = {})
  data, _status_code, _headers = post_team_members_with_http_info(team_key, opts)
  data
end

#post_team_members_with_http_info(team_key, opts = {}) ⇒ Array<(TeamImportsRep, Integer, Hash)>

Add multiple members to team Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](docs.launchdarkly.com/home/teams/managing#managing-team-members). **Members are only added on a &#x60;201&#x60; response.** A &#x60;207&#x60; indicates the CSV file contains a combination of valid and invalid entries. A &#x60;207&#x60; results in no members being added to the team. On a &#x60;207&#x60; response, if an entry contains bad user input, the &#x60;message&#x60; field contains the row number as well as the reason for the error. The &#x60;message&#x60; field is omitted if the entry is valid. Example &#x60;207&#x60; response: &#x60;&#x60;&#x60;json { &quot;items&quot;: [ { &quot;status&quot;: &quot;success&quot;, &quot;value&quot;: &quot;[email protected]&quot; }, { &quot;message&quot;: &quot;Line 2: empty row&quot;, &quot;status&quot;: &quot;error&quot;, &quot;value&quot;: &quot;&quot; }, { &quot;message&quot;: &quot;Line 3: email already exists in the specified team&quot;, &quot;status&quot;: &quot;error&quot;, &quot;value&quot;: &quot;[email protected]&quot; }, { &quot;message&quot;: &quot;Line 4: invalid email formatting&quot;, &quot;status&quot;: &quot;error&quot;, &quot;value&quot;: &quot;invalid email format&quot; } ] } &#x60;&#x60;&#x60; Message | Resolution — | — Empty row | This line is blank. Add an email address and try again. Duplicate entry | This email address appears in the file twice. Remove the email from the file and try again. Email already exists in the specified team | This member is already on your team. Remove the email from the file and try again. Invalid formatting | This email address is not formatted correctly. Fix the formatting and try again. Email does not belong to a LaunchDarkly member | The email address doesn&#39;t belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team. On a &#x60;400&#x60; response, the &#x60;message&#x60; field may contain errors specific to this endpoint. Example &#x60;400&#x60; response: &#x60;&#x60;&#x60;json { &quot;code&quot;: &quot;invalid_request&quot;, &quot;message&quot;: &quot;Unable to process file&quot; } &#x60;&#x60;&#x60; Message | Resolution — | — Unable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again. File exceeds 25mb | Break up your file into multiple files of less than 25mbs each. All emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again. All emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again. File is empty | The CSV file does not contain any email addresses. Populate the file and try again. No emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.

Parameters:

  • team_key (String)

    The team key

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    CSV file containing email addresses

Returns:

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

    TeamImportsRep data, response status code and response headers



523
524
525
526
527
528
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
# File 'lib/launchdarkly_api/api/teams_api.rb', line 523

def post_team_members_with_http_info(team_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.post_team_members ...'
  end
  # verify the required parameter 'team_key' is set
  if @api_client.config.client_side_validation && team_key.nil?
    fail ArgumentError, "Missing the required parameter 'team_key' when calling TeamsApi.post_team_members"
  end
  # resource path
  local_var_path = '/api/v2/teams/{teamKey}/members'.sub('{' + 'teamKey' + '}', CGI.escape(team_key.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'])
  # 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['file'] = opts[:'file'] if !opts[:'file'].nil?

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

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

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

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

#post_team_with_http_info(team_post_input, opts = {}) ⇒ Array<(Team, Integer, Hash)>

Create team Create a team. To learn more, read [Creating a team](docs.launchdarkly.com/home/teams/creating). ### Expanding the teams response LaunchDarkly supports four fields for expanding the &quot;Create team&quot; response. By default, these fields are not included in the response. To expand the response, append the &#x60;expand&#x60; query parameter and add a comma-separated list with any of the following fields: * &#x60;members&#x60; includes the total count of members that belong to the team. * &#x60;roles&#x60; includes a paginated list of the custom roles that you have assigned to the team. * &#x60;projects&#x60; includes a paginated list of the projects that the team has any write access to. * &#x60;maintainers&#x60; includes a paginated list of the maintainers that you have assigned to the team. For example, &#x60;expand&#x3D;members,roles&#x60; includes the &#x60;members&#x60; and &#x60;roles&#x60; fields in the response.

Parameters:

  • team_post_input (TeamPostInput)
  • 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. Supported fields are explained above.

Returns:

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

    Team data, response status code and response headers



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

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

  # 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'])
  # 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(team_post_input)

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

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

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