Class: LaunchDarklyApi::ReleasesBetaApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::ReleasesBetaApi
- Defined in:
- lib/launchdarkly_api/api/releases_beta_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_release_by_flag_key(project_key, flag_key, opts = {}) ⇒ Release
Get release for flag Get currently active release for a flag.
-
#get_release_by_flag_key_with_http_info(project_key, flag_key, opts = {}) ⇒ Array<(Release, Integer, Hash)>
Get release for flag Get currently active release for a flag.
-
#initialize(api_client = ApiClient.default) ⇒ ReleasesBetaApi
constructor
A new instance of ReleasesBetaApi.
-
#patch_release_by_flag_key(project_key, flag_key, patch_operation, opts = {}) ⇒ nil
Patch release for flag Update currently active release for a flag.
-
#patch_release_by_flag_key_with_http_info(project_key, flag_key, patch_operation, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Patch release for flag Update currently active release for a flag.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ReleasesBetaApi
Returns a new instance of ReleasesBetaApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/releases_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/releases_beta_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_release_by_flag_key(project_key, flag_key, opts = {}) ⇒ Release
Get release for flag Get currently active release for a flag
28 29 30 31 |
# File 'lib/launchdarkly_api/api/releases_beta_api.rb', line 28 def get_release_by_flag_key(project_key, flag_key, opts = {}) data, _status_code, _headers = get_release_by_flag_key_with_http_info(project_key, flag_key, opts) data end |
#get_release_by_flag_key_with_http_info(project_key, flag_key, opts = {}) ⇒ Array<(Release, Integer, Hash)>
Get release for flag Get currently active release for a flag
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 89 |
# File 'lib/launchdarkly_api/api/releases_beta_api.rb', line 39 def get_release_by_flag_key_with_http_info(project_key, flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ReleasesBetaApi.get_release_by_flag_key ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling ReleasesBetaApi.get_release_by_flag_key" end # verify the required parameter 'flag_key' is set if @api_client.config.client_side_validation && flag_key.nil? fail ArgumentError, "Missing the required parameter 'flag_key' when calling ReleasesBetaApi.get_release_by_flag_key" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{flagKey}/release'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'flagKey' + '}', CGI.escape(flag_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] || 'Release' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ReleasesBetaApi.get_release_by_flag_key", :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: ReleasesBetaApi#get_release_by_flag_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_release_by_flag_key(project_key, flag_key, patch_operation, opts = {}) ⇒ nil
Patch release for flag Update currently active release for a flag. Updating releases requires the [JSON patch](datatracker.ietf.org/doc/html/rfc6902) format. To learn more, read [Updates](/#section/Overview/Updates). You can only use this endpoint to mark a release phase complete or incomplete. To indicate which phase to update, use the array index in the ‘path`. For example, to mark the first phase of a release as complete, use the following request body: “` [ { "op": "replace", "path": "/phase/0/complete", "value": true } ] “`
98 99 100 101 |
# File 'lib/launchdarkly_api/api/releases_beta_api.rb', line 98 def patch_release_by_flag_key(project_key, flag_key, patch_operation, opts = {}) patch_release_by_flag_key_with_http_info(project_key, flag_key, patch_operation, opts) nil end |
#patch_release_by_flag_key_with_http_info(project_key, flag_key, patch_operation, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Patch release for flag Update currently active release for a flag. Updating releases requires the [JSON patch](datatracker.ietf.org/doc/html/rfc6902) format. To learn more, read [Updates](/#section/Overview/Updates). You can only use this endpoint to mark a release phase complete or incomplete. To indicate which phase to update, use the array index in the `path`. For example, to mark the first phase of a release as complete, use the following request body: ``` [ { "op": "replace", "path": "/phase/0/complete", "value": true } ] ```
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 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/launchdarkly_api/api/releases_beta_api.rb', line 110 def patch_release_by_flag_key_with_http_info(project_key, flag_key, patch_operation, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ReleasesBetaApi.patch_release_by_flag_key ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling ReleasesBetaApi.patch_release_by_flag_key" end # verify the required parameter 'flag_key' is set if @api_client.config.client_side_validation && flag_key.nil? fail ArgumentError, "Missing the required parameter 'flag_key' when calling ReleasesBetaApi.patch_release_by_flag_key" 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 ReleasesBetaApi.patch_release_by_flag_key" end # resource path local_var_path = '/api/v2/flags/{projectKey}/{flagKey}/release'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'flagKey' + '}', CGI.escape(flag_key.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # 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(patch_operation) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] = opts.merge( :operation => :"ReleasesBetaApi.patch_release_by_flag_key", :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: ReleasesBetaApi#patch_release_by_flag_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |