Class: LaunchDarklyApi::TeamsBetaApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::TeamsBetaApi
- Defined in:
- lib/launchdarkly_api/api/teams_beta_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ TeamsBetaApi
constructor
A new instance of TeamsBetaApi.
-
#patch_teams(teams_patch_input, opts = {}) ⇒ BulkEditTeamsRep
Update teams Perform a partial update to multiple teams.
-
#patch_teams_with_http_info(teams_patch_input, opts = {}) ⇒ Array<(BulkEditTeamsRep, Integer, Hash)>
Update teams Perform a partial update to multiple teams.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TeamsBetaApi
Returns a new instance of TeamsBetaApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/teams_beta_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/launchdarkly_api/api/teams_beta_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#patch_teams(teams_patch_input, opts = {}) ⇒ BulkEditTeamsRep
Update teams
Perform a partial update to multiple teams. Updating teams 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 teams. Click to expand instructions for updating teams
#### addMembersToTeams Add the members to teams. ##### Parameters - memberIDs: List of member IDs to add. - teamKeys: List of teams to update. Here's an example: json { \"instructions\": [{ \"kind\": \"addMembersToTeams\", \"memberIDs\": [ \"1234a56b7c89d012345e678f\" ], \"teamKeys\": [ \"example-team-1\", \"example-team-2\" ] }] } #### addAllMembersToTeams Add all members to the team. Members that match any of the filters are excluded from the update. ##### Parameters - teamKeys: List of teams to update. - 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\": \"addAllMembersToTeams\", \"teamKeys\": [ \"example-team-1\", \"example-team-2\" ], \"filterLastSeen\": { \"never\": true } }] }
27 28 29 30 |
# File 'lib/launchdarkly_api/api/teams_beta_api.rb', line 27 def patch_teams(teams_patch_input, opts = {}) data, _status_code, _headers = patch_teams_with_http_info(teams_patch_input, opts) data end |
#patch_teams_with_http_info(teams_patch_input, opts = {}) ⇒ Array<(BulkEditTeamsRep, Integer, Hash)>
Update teams Perform a partial update to multiple teams. Updating teams 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 teams. <details> <summary>Click to expand instructions for <strong>updating teams</strong></summary> #### addMembersToTeams Add the members to teams. ##### Parameters - `memberIDs`: List of member IDs to add. - `teamKeys`: List of teams to update. Here's an example: ```json { "instructions": [{ "kind": "addMembersToTeams", "memberIDs": [ "1234a56b7c89d012345e678f" ], "teamKeys": [ "example-team-1", "example-team-2" ] }] } ``` #### addAllMembersToTeams Add all members to the team. Members that match any of the filters are excluded from the update. ##### Parameters - `teamKeys`: List of teams to update. - `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 { "instructions": [{ "kind": "addAllMembersToTeams", "teamKeys": [ "example-team-1", "example-team-2" ], "filterLastSeen": { "never": true } }] } ``` </details>
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 84 85 86 87 88 |
# File 'lib/launchdarkly_api/api/teams_beta_api.rb', line 37 def patch_teams_with_http_info(teams_patch_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsBetaApi.patch_teams ...' end # verify the required parameter 'teams_patch_input' is set if @api_client.config.client_side_validation && teams_patch_input.nil? fail ArgumentError, "Missing the required parameter 'teams_patch_input' when calling TeamsBetaApi.patch_teams" end # resource path local_var_path = '/api/v2/teams' # 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(teams_patch_input) # return_type return_type = opts[:debug_return_type] || 'BulkEditTeamsRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"TeamsBetaApi.patch_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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsBetaApi#patch_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |