Skip to content

Latest commit

 

History

History
450 lines (321 loc) · 16.3 KB

AccountMembersApi.md

File metadata and controls

450 lines (321 loc) · 16.3 KB

LaunchDarklyApi::AccountMembersApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
delete_member DELETE /api/v2/members/{id} Delete account member
get_member GET /api/v2/members/{id} Get account member
get_members GET /api/v2/members List account members
patch_member PATCH /api/v2/members/{id} Modify an account member
post_member_teams POST /api/v2/members/{id}/teams Add a member to teams
post_members POST /api/v2/members Invite new members

delete_member

delete_member(id)

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.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
id = 'id_example' # String | The member ID

begin
  # Delete account member
  api_instance.delete_member(id)
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->delete_member: #{e}"
end

Using the delete_member_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> delete_member_with_http_info(id)

begin
  # Delete account member
  data, status_code, headers = api_instance.delete_member_with_http_info(id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->delete_member_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The member ID

Return type

nil (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_member

get_member(id)

Get account member

Get a single account member by member ID. me is a reserved value for the id parameter and returns the caller's member information.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
id = 'id_example' # String | The member ID

begin
  # Get account member
  result = api_instance.get_member(id)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->get_member: #{e}"
end

Using the get_member_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_member_with_http_info(id)

begin
  # Get account member
  data, status_code, headers = api_instance.get_member_with_http_info(id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Member>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->get_member_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The member ID

Return type

Member

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_members

get_members(opts)

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 three fields for filters: query, role, and lastSeen: - 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. - team is a string that matches against the key of the teams the members belong to. It is not case sensitive. - 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. 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 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.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
opts = {
  limit: 789, # Integer | The number of members to return in the response. Defaults to 20.
  offset: 789, # 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: 'filter_example', # String | A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.
  sort: 'sort_example' # String | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.
}

begin
  # List account members
  result = api_instance.get_members(opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->get_members: #{e}"
end

Using the get_members_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_members_with_http_info(opts)

begin
  # List account members
  data, status_code, headers = api_instance.get_members_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Members>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->get_members_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
limit Integer The number of members to return in the response. Defaults to 20. [optional]
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`. [optional]
filter String A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above. [optional]
sort String A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. [optional]

Return type

Members

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

patch_member

patch_member(id, patch_operation)

Modify an account member

Update a single account member. The request should be a valid JSON Patch document describing the changes to be made to the member. 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>. Using /0 appends to the beginning 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\" } ] Requests to update account members will not work if SCIM is enabled for the account.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
id = 'id_example' # String | The member ID
patch_operation = [LaunchDarklyApi::PatchOperation.new({op: 'replace', path: '/exampleField', value: new example value})] # Array<PatchOperation> | 

begin
  # Modify an account member
  result = api_instance.patch_member(id, patch_operation)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->patch_member: #{e}"
end

Using the patch_member_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> patch_member_with_http_info(id, patch_operation)

begin
  # Modify an account member
  data, status_code, headers = api_instance.patch_member_with_http_info(id, patch_operation)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Member>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->patch_member_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The member ID
patch_operation Array<PatchOperation>

Return type

Member

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

post_member_teams

post_member_teams(id, member_teams_post_input)

Add a member to teams

Add one member to one or more teams.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
id = 'id_example' # String | The member ID
member_teams_post_input = LaunchDarklyApi::MemberTeamsPostInput.new({team_keys: ["team1", "team2"]}) # MemberTeamsPostInput | 

begin
  # Add a member to teams
  result = api_instance.post_member_teams(id, member_teams_post_input)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->post_member_teams: #{e}"
end

Using the post_member_teams_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> post_member_teams_with_http_info(id, member_teams_post_input)

begin
  # Add a member to teams
  data, status_code, headers = api_instance.post_member_teams_with_http_info(id, member_teams_post_input)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Member>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->post_member_teams_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The member ID
member_teams_post_input MemberTeamsPostInput

Return type

Member

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

post_members

post_members(new_member_form)

Invite new members

Full use of this API resource is only available to customers on an Enterprise plan > > The ability to bulk invite members is an Enterprise feature. On a starter or Pro plan? You can invite members individually. 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. 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).

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::AccountMembersApi.new
new_member_form = [LaunchDarklyApi::NewMemberForm.new({email: '[email protected]'})] # Array<NewMemberForm> | 

begin
  # Invite new members
  result = api_instance.post_members(new_member_form)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->post_members: #{e}"
end

Using the post_members_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> post_members_with_http_info(new_member_form)

begin
  # Invite new members
  data, status_code, headers = api_instance.post_members_with_http_info(new_member_form)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Members>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling AccountMembersApi->post_members_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
new_member_form Array<NewMemberForm>

Return type

Members

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json