Class: LaunchDarklyApi::ApprovalsBetaApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::ApprovalsBetaApi
- Defined in:
- lib/launchdarkly_api/api/approvals_beta_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_approval_request(id, opts = {}) ⇒ ExpandableApprovalRequestResponse
Get approval request Get an approval request by approval request ID.
-
#get_approval_request_with_http_info(id, opts = {}) ⇒ Array<(ExpandableApprovalRequestResponse, Integer, Hash)>
Get approval request Get an approval request by approval request ID.
-
#get_approval_requests(opts = {}) ⇒ ExpandableApprovalRequestsResponse
List approval requests Get all approval requests.
-
#get_approval_requests_with_http_info(opts = {}) ⇒ Array<(ExpandableApprovalRequestsResponse, Integer, Hash)>
List approval requests Get all approval requests.
-
#initialize(api_client = ApiClient.default) ⇒ ApprovalsBetaApi
constructor
A new instance of ApprovalsBetaApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ApprovalsBetaApi
Returns a new instance of ApprovalsBetaApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/approvals_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/approvals_beta_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_approval_request(id, opts = {}) ⇒ ExpandableApprovalRequestResponse
Get approval request Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the ‘expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environment` includes the environment the approval request belongs to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
28 29 30 31 |
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 28 def get_approval_request(id, opts = {}) data, _status_code, _headers = get_approval_request_with_http_info(id, opts) data end |
#get_approval_request_with_http_info(id, opts = {}) ⇒ Array<(ExpandableApprovalRequestResponse, Integer, Hash)>
Get approval request Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environment` includes the environment the approval request belongs to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
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 |
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 39 def get_approval_request_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.get_approval_request ...' 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 ApprovalsBetaApi.get_approval_request" end # resource path local_var_path = '/api/v2/approval-requests/{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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ExpandableApprovalRequestResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ApprovalsBetaApi.get_approval_request", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsBetaApi#get_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_approval_requests(opts = {}) ⇒ ExpandableApprovalRequestsResponse
List approval requests Get all approval requests. ### Filtering approvals LaunchDarkly supports the ‘filter` query param for filtering, with the following fields: - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. - `projectKey` filters for only approvals that correspond to the specified project key. For example: `filter=projectKey equals my-project`. - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environment` includes the environment the approval request belongs to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
96 97 98 99 |
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 96 def get_approval_requests(opts = {}) data, _status_code, _headers = get_approval_requests_with_http_info(opts) data end |
#get_approval_requests_with_http_info(opts = {}) ⇒ Array<(ExpandableApprovalRequestsResponse, Integer, Hash)>
List approval requests Get all approval requests. ### Filtering approvals LaunchDarkly supports the `filter` query param for filtering, with the following fields: - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. - `projectKey` filters for only approvals that correspond to the specified project key. For example: `filter=projectKey equals my-project`. - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environment` includes the environment the approval request belongs to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.
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 150 151 152 153 154 155 |
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 109 def get_approval_requests_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.get_approval_requests ...' end # resource path local_var_path = '/api/v2/approval-requests' # query parameters query_params = opts[:query_params] || {} query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil? 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] || 'ExpandableApprovalRequestsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ApprovalsBetaApi.get_approval_requests", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsBetaApi#get_approval_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |