Class: LaunchDarklyApi::UserSegmentsApi
- Inherits:
-
Object
- Object
- LaunchDarklyApi::UserSegmentsApi
- Defined in:
- lib/launchdarkly_api/api/user_segments_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ nil
Delete a user segment.
-
#delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a user segment.
-
#get_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ UserSegment
Get a single user segment by key.
-
#get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Get a single user segment by key.
-
#get_user_segments(project_key, environment_key, opts = {}) ⇒ UserSegments
Get a list of all user segments in the given project.
-
#get_user_segments_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(UserSegments, Fixnum, Hash)>
Get a list of all user segments in the given project.
-
#initialize(api_client = ApiClient.default) ⇒ UserSegmentsApi
constructor
A new instance of UserSegmentsApi.
-
#patch_user_segment(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ UserSegment
Perform a partial update to a user segment.
-
#patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Perform a partial update to a user segment.
-
#post_user_segment(project_key, environment_key, user_segment_body, opts = {}) ⇒ UserSegment
Creates a new user segment.
-
#post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Creates a new user segment.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ UserSegmentsApi
Returns a new instance of UserSegmentsApi.
19 20 21 |
# File 'lib/launchdarkly_api/api/user_segments_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/user_segments_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ nil
Delete a user segment.
28 29 30 31 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 28 def delete_user_segment(project_key, environment_key, user_segment_key, opts = {}) delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts) nil end |
#delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a user segment.
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 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 39 def delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSegmentsApi.delete_user_segment ...' 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 UserSegmentsApi.delete_user_segment" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.delete_user_segment" end # verify the required parameter 'user_segment_key' is set if @api_client.config.client_side_validation && user_segment_key.nil? fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.delete_user_segment" end # resource path local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s) # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSegmentsApi#delete_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ UserSegment
Get a single user segment by key.
91 92 93 94 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 91 def get_user_segment(project_key, environment_key, user_segment_key, opts = {}) data, _status_code, _headers = get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts) data end |
#get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Get a single user segment by key.
102 103 104 105 106 107 108 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 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 102 def get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSegmentsApi.get_user_segment ...' 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 UserSegmentsApi.get_user_segment" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.get_user_segment" end # verify the required parameter 'user_segment_key' is set if @api_client.config.client_side_validation && user_segment_key.nil? fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.get_user_segment" end # resource path local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s) # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserSegment') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSegmentsApi#get_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_user_segments(project_key, environment_key, opts = {}) ⇒ UserSegments
Get a list of all user segments in the given project.
155 156 157 158 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 155 def get_user_segments(project_key, environment_key, opts = {}) data, _status_code, _headers = get_user_segments_with_http_info(project_key, environment_key, opts) data end |
#get_user_segments_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(UserSegments, Fixnum, Hash)>
Get a list of all user segments in the given project.
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 166 def get_user_segments_with_http_info(project_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSegmentsApi.get_user_segments ...' 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 UserSegmentsApi.get_user_segments" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.get_user_segments" end # resource path local_var_path = '/segments/{projectKey}/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s) # query parameters query_params = {} query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserSegments') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSegmentsApi#get_user_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_user_segment(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ UserSegment
Perform a partial update to a user segment.
217 218 219 220 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 217 def patch_user_segment(project_key, environment_key, user_segment_key, patch_only, opts = {}) data, _status_code, _headers = patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts) data end |
#patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Perform a partial update to a user segment.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 229 def patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSegmentsApi.patch_user_segment ...' 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 UserSegmentsApi.patch_user_segment" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.patch_user_segment" end # verify the required parameter 'user_segment_key' is set if @api_client.config.client_side_validation && user_segment_key.nil? fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.patch_user_segment" end # verify the required parameter 'patch_only' is set if @api_client.config.client_side_validation && patch_only.nil? fail ArgumentError, "Missing the required parameter 'patch_only' when calling UserSegmentsApi.patch_user_segment" end # resource path local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s) # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(patch_only) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserSegment') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSegmentsApi#patch_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_user_segment(project_key, environment_key, user_segment_body, opts = {}) ⇒ UserSegment
Creates a new user segment.
286 287 288 289 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 286 def post_user_segment(project_key, environment_key, user_segment_body, opts = {}) data, _status_code, _headers = post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts) data end |
#post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>
Creates a new user segment.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 297 def post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserSegmentsApi.post_user_segment ...' 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 UserSegmentsApi.post_user_segment" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.post_user_segment" end # verify the required parameter 'user_segment_body' is set if @api_client.config.client_side_validation && user_segment_body.nil? fail ArgumentError, "Missing the required parameter 'user_segment_body' when calling UserSegmentsApi.post_user_segment" end # resource path local_var_path = '/segments/{projectKey}/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s) # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = @api_client.object_to_http_body(user_segment_body) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserSegment') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserSegmentsApi#post_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |