class LaunchDarklyApi::AccountMembersApi
Attributes
Public Class Methods
# File lib/launchdarkly_api/api/account_members_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete account member Delete a single account member by ID @param id [String] The member ID @param [Hash] opts the optional parameters @return [nil]
# 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 account member Delete a single account member by ID @param id [String] The member ID @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# 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] || {} # 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 account member Get a single account member by ID @param id [String] The member ID @param [Hash] opts the optional parameters @return [Member]
# File lib/launchdarkly_api/api/account_members_api.rb, line 88 def get_member(id, opts = {}) data, _status_code, _headers = get_member_with_http_info(id, opts) data end
Get account member Get a single account member by ID @param id [String] The member ID @param [Hash] opts the optional parameters @return [Array<(Member
, Integer, Hash)>] Member
data, response status code and response headers
# File lib/launchdarkly_api/api/account_members_api.rb, line 98 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] || {} # 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] || '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
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`. - `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. @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of members to return in the response. Defaults
to 20. @option opts [Integer] :offset Where to start in the list. This is for use with pagination. For example, an offset of 10 would skip the first ten items and then return the next `limit` items. @option opts [String] :filter A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained below. @option opts [String] :sort A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. @return [Members]
# File lib/launchdarkly_api/api/account_members_api.rb, line 154 def get_members(opts = {}) data, _status_code, _headers = get_members_with_http_info(opts) data end
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`. - `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. @param [Hash] opts the optional parameters @option opts [Integer] :limit The number of members to return in the response. Defaults
to 20. @option opts [Integer] :offset Where to start in the list. This is for use with pagination. For example, an offset of 10 would skip the first ten items and then return the next `limit` items. @option opts [String] :filter A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained below. @option opts [String] :sort A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. @return [Array<(Members
, Integer, Hash)>] Members
data, response status code and response headers
# File lib/launchdarkly_api/api/account_members_api.rb, line 167 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[:'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']) # 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
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. @param id [String] The member ID @param patch_operation [Array<PatchOperation>] @param [Hash] opts the optional parameters @return [Member]
# File lib/launchdarkly_api/api/account_members_api.rb, line 221 def patch_member(id, patch_operation, opts = {}) data, _status_code, _headers = patch_member_with_http_info(id, patch_operation, opts) data end
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. @param id [String] The member ID @param patch_operation [Array<PatchOperation>] @param [Hash] opts the optional parameters @return [Array<(Member
, Integer, Hash)>] Member
data, response status code and response headers
# File lib/launchdarkly_api/api/account_members_api.rb, line 232 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # 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
Invite new members > ### Full use of this API resource is only available to accounts with paid subscriptions > > The ability to bulk invite members is a paid feature. Single members may be invited if not on a paid plan. 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. _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_email**s: 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). @param inline_object1 [Array<InlineObject1>] @param [Hash] opts the optional parameters @return [Members]
# File lib/launchdarkly_api/api/account_members_api.rb, line 291 def post_members(inline_object1, opts = {}) data, _status_code, _headers = post_members_with_http_info(inline_object1, opts) data end
Invite new members > ### Full use of this API resource is only available to accounts with paid subscriptions > > The ability to bulk invite members is a paid feature. Single members may be invited if not on a paid plan. 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. _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_email**s: 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). @param inline_object1 [Array<InlineObject1>] @param [Hash] opts the optional parameters @return [Array<(Members
, Integer, Hash)>] Members
data, response status code and response headers
# File lib/launchdarkly_api/api/account_members_api.rb, line 301 def post_members_with_http_info(inline_object1, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountMembersApi.post_members ...' end # verify the required parameter 'inline_object1' is set if @api_client.config.client_side_validation && inline_object1.nil? fail ArgumentError, "Missing the required parameter 'inline_object1' 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(inline_object1) # 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