launchdarkly_api 18.0.2 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -4
  3. data/docs/AIConfig.md +3 -1
  4. data/docs/AiConfigsMetricDataSourceRefRep.md +1 -1
  5. data/docs/AiConfigsMetricListingRep.md +1 -1
  6. data/docs/DataExportDestinationsApi.md +74 -0
  7. data/docs/Environment.md +2 -0
  8. data/docs/Experiment.md +2 -0
  9. data/docs/ExperimentPost.md +3 -1
  10. data/docs/FeatureFlagsApi.md +2 -2
  11. data/docs/GenerateTrustPolicyPostRep.md +18 -0
  12. data/docs/MetricDataSourceRefRep.md +1 -1
  13. data/docs/MetricGroupRep.md +1 -5
  14. data/docs/MetricListingRep.md +1 -1
  15. data/docs/MetricRep.md +1 -1
  16. data/docs/Metrics.md +7 -1
  17. data/docs/MetricsApi.md +3 -3
  18. data/docs/MetricsBetaApi.md +3 -3
  19. data/docs/PostReleasePolicyRequest.md +1 -1
  20. data/docs/PutReleasePolicyRequest.md +1 -1
  21. data/docs/RelayAutoConfigRep.md +1 -1
  22. data/docs/ReleasePolicy.md +1 -1
  23. data/docs/ScheduledChangesApi.md +1 -1
  24. data/docs/SegmentsApi.md +1 -1
  25. data/docs/TrustPolicyDetails.md +20 -0
  26. data/docs/TrustPolicyStatement.md +24 -0
  27. data/lib/launchdarkly_api/api/data_export_destinations_api.rb +69 -0
  28. data/lib/launchdarkly_api/api/feature_flags_api.rb +2 -2
  29. data/lib/launchdarkly_api/api/metrics_api.rb +4 -4
  30. data/lib/launchdarkly_api/api/metrics_beta_api.rb +4 -4
  31. data/lib/launchdarkly_api/api/scheduled_changes_api.rb +2 -2
  32. data/lib/launchdarkly_api/api/segments_api.rb +2 -2
  33. data/lib/launchdarkly_api/models/ai_config.rb +16 -4
  34. data/lib/launchdarkly_api/models/ai_configs_metric_data_source_ref_rep.rb +17 -0
  35. data/lib/launchdarkly_api/models/ai_configs_metric_listing_rep.rb +17 -0
  36. data/lib/launchdarkly_api/models/destination.rb +2 -2
  37. data/lib/launchdarkly_api/models/destination_post.rb +2 -2
  38. data/lib/launchdarkly_api/models/environment.rb +10 -1
  39. data/lib/launchdarkly_api/models/experiment.rb +13 -1
  40. data/lib/launchdarkly_api/models/experiment_post.rb +16 -4
  41. data/lib/launchdarkly_api/models/generate_trust_policy_post_rep.rb +220 -0
  42. data/lib/launchdarkly_api/models/iteration_rep.rb +29 -5
  43. data/lib/launchdarkly_api/models/metric_data_source_ref_rep.rb +17 -0
  44. data/lib/launchdarkly_api/models/metric_group_rep.rb +4 -24
  45. data/lib/launchdarkly_api/models/metric_listing_rep.rb +17 -0
  46. data/lib/launchdarkly_api/models/metric_rep.rb +17 -0
  47. data/lib/launchdarkly_api/models/metrics.rb +118 -4
  48. data/lib/launchdarkly_api/models/naming_convention.rb +2 -2
  49. data/lib/launchdarkly_api/models/relay_auto_config_rep.rb +0 -17
  50. data/lib/launchdarkly_api/models/trust_policy_details.rb +233 -0
  51. data/lib/launchdarkly_api/models/trust_policy_statement.rb +255 -0
  52. data/lib/launchdarkly_api/version.rb +1 -1
  53. data/lib/launchdarkly_api.rb +3 -0
  54. data/spec/api/data_export_destinations_api_spec.rb +13 -0
  55. data/spec/api/feature_flags_api_spec.rb +1 -1
  56. data/spec/api/metrics_api_spec.rb +2 -2
  57. data/spec/api/metrics_beta_api_spec.rb +2 -2
  58. data/spec/api/scheduled_changes_api_spec.rb +1 -1
  59. data/spec/api/segments_api_spec.rb +1 -1
  60. data/spec/models/ai_config_spec.rb +6 -0
  61. data/spec/models/destination_post_spec.rb +1 -1
  62. data/spec/models/destination_spec.rb +1 -1
  63. data/spec/models/environment_spec.rb +6 -0
  64. data/spec/models/experiment_post_spec.rb +6 -0
  65. data/spec/models/experiment_spec.rb +6 -0
  66. data/spec/models/generate_trust_policy_post_rep_spec.rb +36 -0
  67. data/spec/models/iteration_rep_spec.rb +4 -0
  68. data/spec/models/metric_group_rep_spec.rb +0 -12
  69. data/spec/models/metrics_spec.rb +18 -0
  70. data/spec/models/naming_convention_spec.rb +1 -1
  71. data/spec/models/trust_policy_details_spec.rb +42 -0
  72. data/spec/models/trust_policy_statement_spec.rb +54 -0
  73. metadata +14 -2
@@ -408,6 +408,8 @@ module LaunchDarklyApi
408
408
 
409
409
  if attributes.key?(:'data_source')
410
410
  self.data_source = attributes[:'data_source']
411
+ else
412
+ self.data_source = nil
411
413
  end
412
414
 
413
415
  if attributes.key?(:'archived')
@@ -466,6 +468,10 @@ module LaunchDarklyApi
466
468
  invalid_properties.push('invalid value for "_creation_date", _creation_date cannot be nil.')
467
469
  end
468
470
 
471
+ if @data_source.nil?
472
+ invalid_properties.push('invalid value for "data_source", data_source cannot be nil.')
473
+ end
474
+
469
475
  invalid_properties
470
476
  end
471
477
 
@@ -489,6 +495,7 @@ module LaunchDarklyApi
489
495
  return false unless unit_aggregation_type_validator.valid?(@unit_aggregation_type)
490
496
  analysis_type_validator = EnumAttributeValidator.new('String', ["mean", "percentile"])
491
497
  return false unless analysis_type_validator.valid?(@analysis_type)
498
+ return false if @data_source.nil?
492
499
  true
493
500
  end
494
501
 
@@ -602,6 +609,16 @@ module LaunchDarklyApi
602
609
  @analysis_type = analysis_type
603
610
  end
604
611
 
612
+ # Custom attribute writer method with validation
613
+ # @param [Object] data_source Value to be assigned
614
+ def data_source=(data_source)
615
+ if data_source.nil?
616
+ fail ArgumentError, 'data_source cannot be nil'
617
+ end
618
+
619
+ @data_source = data_source
620
+ end
621
+
605
622
  # Checks equality by comparing each attribute.
606
623
  # @param [Object] Object to be compared
607
624
  def ==(o)
@@ -167,7 +167,7 @@ module LaunchDarklyApi
167
167
  # @return true if the model is valid
168
168
  def valid?
169
169
  warn '[DEPRECATED] the `valid?` method is obsolete'
170
- kind_validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery"])
170
+ kind_validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery", "redshift"])
171
171
  return false unless kind_validator.valid?(@kind)
172
172
  true
173
173
  end
@@ -175,7 +175,7 @@ module LaunchDarklyApi
175
175
  # Custom attribute writer method checking allowed values (enum).
176
176
  # @param [Object] kind Object to be assigned
177
177
  def kind=(kind)
178
- validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery"])
178
+ validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery", "redshift"])
179
179
  unless validator.valid?(kind)
180
180
  fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
181
181
  end
@@ -131,7 +131,7 @@ module LaunchDarklyApi
131
131
  # @return true if the model is valid
132
132
  def valid?
133
133
  warn '[DEPRECATED] the `valid?` method is obsolete'
134
- kind_validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery"])
134
+ kind_validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery", "redshift"])
135
135
  return false unless kind_validator.valid?(@kind)
136
136
  true
137
137
  end
@@ -139,7 +139,7 @@ module LaunchDarklyApi
139
139
  # Custom attribute writer method checking allowed values (enum).
140
140
  # @param [Object] kind Object to be assigned
141
141
  def kind=(kind)
142
- validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery"])
142
+ validator = EnumAttributeValidator.new('String', ["google-pubsub", "kinesis", "mparticle", "segment", "azure-event-hubs", "snowflake-v2", "databricks", "bigquery", "redshift"])
143
143
  unless validator.valid?(kind)
144
144
  fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
145
145
  end
@@ -42,6 +42,8 @@ module LaunchDarklyApi
42
42
  # Ensures that one end user of the client-side SDK cannot inspect the variations for another end user
43
43
  attr_accessor :secure_mode
44
44
 
45
+ attr_accessor :_access
46
+
45
47
  # Enables tracking detailed information for new flags by default
46
48
  attr_accessor :default_track_events
47
49
 
@@ -74,6 +76,7 @@ module LaunchDarklyApi
74
76
  :'color' => :'color',
75
77
  :'default_ttl' => :'defaultTtl',
76
78
  :'secure_mode' => :'secureMode',
79
+ :'_access' => :'_access',
77
80
  :'default_track_events' => :'defaultTrackEvents',
78
81
  :'require_comments' => :'requireComments',
79
82
  :'confirm_changes' => :'confirmChanges',
@@ -106,6 +109,7 @@ module LaunchDarklyApi
106
109
  :'color' => :'String',
107
110
  :'default_ttl' => :'Integer',
108
111
  :'secure_mode' => :'Boolean',
112
+ :'_access' => :'Access',
109
113
  :'default_track_events' => :'Boolean',
110
114
  :'require_comments' => :'Boolean',
111
115
  :'confirm_changes' => :'Boolean',
@@ -194,6 +198,10 @@ module LaunchDarklyApi
194
198
  self.secure_mode = nil
195
199
  end
196
200
 
201
+ if attributes.key?(:'_access')
202
+ self._access = attributes[:'_access']
203
+ end
204
+
197
205
  if attributes.key?(:'default_track_events')
198
206
  self.default_track_events = attributes[:'default_track_events']
199
207
  else
@@ -476,6 +484,7 @@ module LaunchDarklyApi
476
484
  color == o.color &&
477
485
  default_ttl == o.default_ttl &&
478
486
  secure_mode == o.secure_mode &&
487
+ _access == o._access &&
479
488
  default_track_events == o.default_track_events &&
480
489
  require_comments == o.require_comments &&
481
490
  confirm_changes == o.confirm_changes &&
@@ -494,7 +503,7 @@ module LaunchDarklyApi
494
503
  # Calculates hash code according to all attributes.
495
504
  # @return [Integer] Hash code
496
505
  def hash
497
- [_links, _id, key, name, api_key, mobile_key, color, default_ttl, secure_mode, default_track_events, require_comments, confirm_changes, tags, approval_settings, resource_approval_settings, critical].hash
506
+ [_links, _id, key, name, api_key, mobile_key, color, default_ttl, secure_mode, _access, default_track_events, require_comments, confirm_changes, tags, approval_settings, resource_approval_settings, critical].hash
498
507
  end
499
508
 
500
509
  # Builds the object from hash
@@ -36,6 +36,9 @@ module LaunchDarklyApi
36
36
 
37
37
  attr_accessor :archived_date
38
38
 
39
+ # Tags for the experiment
40
+ attr_accessor :tags
41
+
39
42
  # The location and content type of related resources
40
43
  attr_accessor :_links
41
44
 
@@ -60,6 +63,7 @@ module LaunchDarklyApi
60
63
  :'_creation_date' => :'_creationDate',
61
64
  :'environment_key' => :'environmentKey',
62
65
  :'archived_date' => :'archivedDate',
66
+ :'tags' => :'tags',
63
67
  :'_links' => :'_links',
64
68
  :'holdout_id' => :'holdoutId',
65
69
  :'current_iteration' => :'currentIteration',
@@ -89,6 +93,7 @@ module LaunchDarklyApi
89
93
  :'_creation_date' => :'Integer',
90
94
  :'environment_key' => :'String',
91
95
  :'archived_date' => :'Integer',
96
+ :'tags' => :'Array<String>',
92
97
  :'_links' => :'Hash<String, Link>',
93
98
  :'holdout_id' => :'String',
94
99
  :'current_iteration' => :'IterationRep',
@@ -161,6 +166,12 @@ module LaunchDarklyApi
161
166
  self.archived_date = attributes[:'archived_date']
162
167
  end
163
168
 
169
+ if attributes.key?(:'tags')
170
+ if (value = attributes[:'tags']).is_a?(Array)
171
+ self.tags = value
172
+ end
173
+ end
174
+
164
175
  if attributes.key?(:'_links')
165
176
  if (value = attributes[:'_links']).is_a?(Hash)
166
177
  self._links = value
@@ -306,6 +317,7 @@ module LaunchDarklyApi
306
317
  _creation_date == o._creation_date &&
307
318
  environment_key == o.environment_key &&
308
319
  archived_date == o.archived_date &&
320
+ tags == o.tags &&
309
321
  _links == o._links &&
310
322
  holdout_id == o.holdout_id &&
311
323
  current_iteration == o.current_iteration &&
@@ -322,7 +334,7 @@ module LaunchDarklyApi
322
334
  # Calculates hash code according to all attributes.
323
335
  # @return [Integer] Hash code
324
336
  def hash
325
- [_id, key, name, description, _maintainer_id, _creation_date, environment_key, archived_date, _links, holdout_id, current_iteration, draft_iteration, previous_iterations].hash
337
+ [_id, key, name, description, _maintainer_id, _creation_date, environment_key, archived_date, tags, _links, holdout_id, current_iteration, draft_iteration, previous_iterations].hash
326
338
  end
327
339
 
328
340
  # Builds the object from hash
@@ -32,6 +32,9 @@ module LaunchDarklyApi
32
32
  # The ID of the holdout
33
33
  attr_accessor :holdout_id
34
34
 
35
+ # Tags for the experiment
36
+ attr_accessor :tags
37
+
35
38
  # Attribute mapping from ruby-style variable name to JSON key.
36
39
  def self.attribute_map
37
40
  {
@@ -40,7 +43,8 @@ module LaunchDarklyApi
40
43
  :'maintainer_id' => :'maintainerId',
41
44
  :'key' => :'key',
42
45
  :'iteration' => :'iteration',
43
- :'holdout_id' => :'holdoutId'
46
+ :'holdout_id' => :'holdoutId',
47
+ :'tags' => :'tags'
44
48
  }
45
49
  end
46
50
 
@@ -62,7 +66,8 @@ module LaunchDarklyApi
62
66
  :'maintainer_id' => :'String',
63
67
  :'key' => :'String',
64
68
  :'iteration' => :'IterationInput',
65
- :'holdout_id' => :'String'
69
+ :'holdout_id' => :'String',
70
+ :'tags' => :'Array<String>'
66
71
  }
67
72
  end
68
73
 
@@ -117,6 +122,12 @@ module LaunchDarklyApi
117
122
  if attributes.key?(:'holdout_id')
118
123
  self.holdout_id = attributes[:'holdout_id']
119
124
  end
125
+
126
+ if attributes.key?(:'tags')
127
+ if (value = attributes[:'tags']).is_a?(Array)
128
+ self.tags = value
129
+ end
130
+ end
120
131
  end
121
132
 
122
133
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -189,7 +200,8 @@ module LaunchDarklyApi
189
200
  maintainer_id == o.maintainer_id &&
190
201
  key == o.key &&
191
202
  iteration == o.iteration &&
192
- holdout_id == o.holdout_id
203
+ holdout_id == o.holdout_id &&
204
+ tags == o.tags
193
205
  end
194
206
 
195
207
  # @see the `==` method
@@ -201,7 +213,7 @@ module LaunchDarklyApi
201
213
  # Calculates hash code according to all attributes.
202
214
  # @return [Integer] Hash code
203
215
  def hash
204
- [name, description, maintainer_id, key, iteration, holdout_id].hash
216
+ [name, description, maintainer_id, key, iteration, holdout_id, tags].hash
205
217
  end
206
218
 
207
219
  # Builds the object from hash
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #LaunchDarkly REST API
3
+
4
+ #This documentation describes LaunchDarkly's REST API. To access the complete OpenAPI spec directly, use [Get OpenAPI spec](https://launchdarkly.com/docs/api/other/get-openapi-spec). To learn how to use LaunchDarkly using the user interface (UI) instead, read our [product documentation](https://launchdarkly.com/docs/home). ## Authentication LaunchDarkly's REST API uses the HTTPS protocol with a minimum TLS version of 1.2. All REST API resources are authenticated with either [personal or service access tokens](https://launchdarkly.com/docs/home/account/api), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [**Authorization**](https://app.launchdarkly.com/settings/authorization) page in the LaunchDarkly UI. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and JavaScript-based SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations such as fetching feature flag settings. | Auth mechanism | Allowed resources | Use cases | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [Personal or service access tokens](https://launchdarkly.com/docs/home/account/api) | Can be customized on a per-token basis | Building scripts, custom integrations, data export. | | SDK keys | Can only access read-only resources specific to server-side SDKs. Restricted to a single environment. | Server-side SDKs | | Mobile keys | Can only access read-only resources specific to mobile SDKs, and only for flags marked available to mobile keys. Restricted to a single environment. | Mobile SDKs | | Client-side ID | Can only access read-only resources specific to JavaScript-based client-side SDKs, and only for flags marked available to client-side. Restricted to a single environment. | Client-side JavaScript | > #### Keep your access tokens and SDK keys private > > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [**Authorization**](https://app.launchdarkly.com/settings/authorization) page. > > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript. ### Authentication using request header The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token. Manage personal access tokens from the [**Authorization**](https://app.launchdarkly.com/settings/authorization) page. ### Authentication using session cookie For testing purposes, you can make API calls directly from your web browser. If you are logged in to the LaunchDarkly application, the API will use your existing session to authenticate calls. Depending on the permissions granted as part of your [role](https://launchdarkly.com/docs/home/account/roles), you may not have permission to perform some API calls. You will receive a `401` response code in that case. > ### Modifying the Origin header causes an error > > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`. > > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly. > > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail. > > To prevent this error, do not modify your Origin header. > > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage. ## Representations All resources expect and return JSON response bodies. Error responses also send a JSON body. To learn more about the error format of the API, read [Errors](https://launchdarkly.com/docs/api#errors). In practice this means that you always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PATCH`, `POST`, and `PUT` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. ### Summary and detailed representations When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation. ### Expanding responses Sometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response. To include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,maintainers` to the [Get team](https://launchdarkly.com/docs/api/teams/get-team) endpoint, the expanded response includes both of these attributes. ### Links and addressability The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links: - Links to other resources within the API are encapsulated in a `_links` object - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link Each link has two attributes: - An `href`, which contains the URL - A `type`, which describes the content type For example, a feature resource might return the following: ```json { \"_links\": { \"parent\": { \"href\": \"/api/features\", \"type\": \"application/json\" }, \"self\": { \"href\": \"/api/features/sort.order\", \"type\": \"application/json\" } }, \"_site\": { \"href\": \"/features/sort.order\", \"type\": \"text/html\" } } ``` From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection. ## Updates Resources that accept partial updates use the `PATCH` verb. Most resources support the [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch) format. Some resources also support the [JSON merge patch](https://launchdarkly.com/docs/api#updates-using-json-merge-patch) format, and some resources support the [semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](https://launchdarkly.com/docs/api#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations. When a resource supports both JSON patch and semantic patch, we document both in the request method. However, the specific request body fields and descriptions included in our documentation only match one type of patch or the other. ### Updates using JSON patch [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value. For example, in this feature flag representation: ```json { \"name\": \"New recommendations engine\", \"key\": \"engine.enable\", \"description\": \"This is the description\", ... } ``` You can change the feature flag's description with the following patch document: ```json [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }] ``` You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch: ```json [ { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 }, { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ] ``` The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description. Attributes that are not editable, such as a resource's `_links`, have names that start with an underscore. ### Updates using JSON merge patch [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch. However, in many cases it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document: ```json { \"description\": \"New flag description\" } ``` ### Updates using semantic patch Some resources support the semantic patch format. A semantic patch is a way to specify the modifications to perform on a resource as a set of executable instructions. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. Here's how: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` If you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch. The body of a semantic patch request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required for some resources only) The environment key. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the instruction requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters. For example: ```json { \"comment\": \"optional comment\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` Semantic patches are not applied partially; either all of the instructions are applied or none of them are. If **any** instruction is invalid, the endpoint returns an error and will not change the resource. If all instructions are valid, the request succeeds and the resources are updated if necessary, or left unchanged if they are already in the state you request. ### Updates with comments You can submit optional comments with `PATCH` changes. To submit a comment along with a JSON patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }] } ``` To submit a comment along with a JSON merge patch document, use the following format: ```json { \"comment\": \"This is a comment string\", \"merge\": { \"description\": \"New flag description\" } } ``` To submit a comment along with a semantic patch, use the following format: ```json { \"comment\": \"This is a comment string\", \"instructions\": [ {\"kind\": \"turnFlagOn\"} ] } ``` ## Errors The API always returns errors in a common format. Here's an example: ```json { \"code\": \"invalid_request\", \"message\": \"A feature with that key already exists\", \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\" } ``` The `code` indicates the general class of error. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly Support to debug a problem with a specific API call. ### HTTP status error response codes | Code | Definition | Description | Possible Solution | | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. | | 401 | Invalid access token | Requestor is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. | | 403 | Forbidden | Requestor does not have access to this resource. | Ensure that the account member or access token has proper permissions set. | | 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by ID or key. | | 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. | | 409 | Conflict | The API request can not be completed because it conflicts with a concurrent API request. | Retry your request. | | 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using, either JSON patch or semantic patch. | 429 | Too many requests | Read [Rate limiting](https://launchdarkly.com/docs/api#rate-limiting). | Wait and try again later. | ## CORS The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise the request returns a wildcard, `Access-Control-Allow-Origin: *`. For more information on CORS, read the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: ```http Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH Access-Control-Allow-Origin: * Access-Control-Max-Age: 300 ``` You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](https://launchdarkly.com/docs/api#authentication). If you are using session authentication, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted entities. ## Rate limiting We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs return a `429` status code. Calls to our APIs include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. > ### Rate limiting and SDKs > > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs. ### Global rate limits Authenticated requests are subject to a global limit. This is the maximum number of calls that your account can make to the API per ten seconds. All service and personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits may return the headers below: | Header name | Description | | ------------------------------ | -------------------------------------------------------------------------------- | | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit. ### Route-level rate limits Some authenticated routes have custom rate limits. These also reset every ten seconds. Any service or personal access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits return the headers below: | Header name | Description | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. | | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. | A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](https://launchdarkly.com/docs/api/environments/delete-environment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. We do not publicly document the specific number of calls that an account can make to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits. ### IP-based rate limiting We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again. ## OpenAPI (Swagger) and client libraries We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API. We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit the [collection of client libraries on GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). You can also use this specification to generate client libraries to interact with our REST API in your language of choice. Our OpenAPI specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to explore our APIs. ## Method overriding Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `DELETE`, `PATCH`, and `PUT` verbs are inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `DELETE`, `PATCH`, and `PUT` requests using a `POST` request. For example, to call a `PATCH` endpoint using a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header. ## Beta resources We sometimes release new API resources in **beta** status before we release them with general availability. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes. We mark beta resources with a \"Beta\" callout in our documentation, pictured below: > ### This feature is in beta > > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources). > > Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible. ### Using beta resources To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you receive a `403` response. Use this header: ``` LD-API-Version: beta ``` ## Federal and EU environments In addition to the commercial versions, LaunchDarkly offers instances for federal agencies and those based in the European Union (EU). ### Federal environments The version of LaunchDarkly that is available on domains controlled by the United States government is different from the version of LaunchDarkly available to the general public. If you are an employee or contractor for a United States federal agency and use LaunchDarkly in your work, you likely use the federal instance of LaunchDarkly. If you are working in the federal instance of LaunchDarkly, the base URI for each request is `https://app.launchdarkly.us`. To learn more, read [LaunchDarkly in federal environments](https://launchdarkly.com/docs/home/infrastructure/federal). ### EU environments The version of LaunchDarkly that is available in the EU is different from the version of LaunchDarkly available to other regions. If you are based in the EU, you likely use the EU instance of LaunchDarkly. The LaunchDarkly EU instance complies with EU data residency principles, including the protection and confidentiality of EU customer information. If you are working in the EU instance of LaunchDarkly, the base URI for each request is `https://app.eu.launchdarkly.com`. To learn more, read [LaunchDarkly in the European Union (EU)](https://launchdarkly.com/docs/home/infrastructure/eu). ## Versioning We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace. ### Setting the API version per request You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below: ``` LD-API-Version: 20240415 ``` The header value is the version number of the API version you would like to request. The number for each version corresponds to the date the version was released in `yyyymmdd` format. In the example above the version `20240415` corresponds to April 15, 2024. ### Setting the API version per access token When you create an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes. Tokens created before versioning was released have their version set to `20160426`, which is the version of the API that existed before the current versioning scheme, so that they continue working the same way they did before versioning. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above. > ### Best practice: Set the header for every client or integration > > We recommend that you set the API version header explicitly in any client or integration you build. > > Only rely on the access token API version during manual testing. ### API version changelog <table> <tr> <th>Version</th> <th>Changes</th> <th>End of life (EOL)</th> </tr> <tr> <td>`20240415`</td> <td> <ul><li>Changed several endpoints from unpaginated to paginated. Use the `limit` and `offset` query parameters to page through the results.</li> <li>Changed the [list access tokens](https://launchdarkly.com/docs/api/access-tokens/get-tokens) endpoint: <ul><li>Response is now paginated with a default limit of `25`</li></ul></li> <li>Changed the [list account members](https://launchdarkly.com/docs/api/account-members/get-members) endpoint: <ul><li>The `accessCheck` filter is no longer available</li></ul></li> <li>Changed the [list custom roles](https://launchdarkly.com/docs/api/custom-roles/get-custom-roles) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `environments` field is now only returned if the request is filtered by environment, using the `filterEnv` query parameter</li><li>The `followerId`, `hasDataExport`, `status`, `contextKindTargeted`, and `segmentTargeted` filters are no longer available</li><li>The `compare` query parameter is no longer available</li></ul></li> <li>Changed the [list segments](https://launchdarkly.com/docs/api/segments/get-segments) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list teams](https://launchdarkly.com/docs/api/teams/get-teams) endpoint: <ul><li>The `expand` parameter no longer supports including `projects` or `roles`</li><li>In paginated results, the maximum page size is now 100</li></ul></li> <li>Changed the [get workflows](https://launchdarkly.com/docs/api/workflows/get-workflows) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `_conflicts` field in the response is no longer available</li></ul></li> </ul> </td> <td>Current</td> </tr> <tr> <td>`20220603`</td> <td> <ul><li>Changed the [list projects](https://launchdarkly.com/docs/api/projects/get-projects) return value:<ul><li>Response is now paginated with a default limit of `20`.</li><li>Added support for filter and sort.</li><li>The project `environments` field is now expandable. This field is omitted by default.</li></ul></li><li>Changed the [get project](https://launchdarkly.com/docs/api/projects/get-project) return value:<ul><li>The `environments` field is now expandable. This field is omitted by default.</li></ul></li></ul> </td> <td>2025-04-15</td> </tr> <tr> <td>`20210729`</td> <td> <ul><li>Changed the [create approval request](https://launchdarkly.com/docs/api/approvals/post-approval-request) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get user](https://launchdarkly.com/docs/api/users/get-user) return value. It now returns a user record, not a user. </li><li>Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create big segments. </li><li> Added default values for flag variations when new environments are created. </li><li>Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li>Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul> </td> <td>2023-06-03</td> </tr> <tr> <td>`20191212`</td> <td> <ul><li>[List feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul> </td> <td>2022-07-29</td> </tr> <tr> <td>`20160426`</td> <td> <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul> </td> <td>2020-12-12</td> </tr> </table> To learn more about how EOL is determined, read LaunchDarkly's [End of Life (EOL) Policy](https://launchdarkly.com/policies/end-of-life-policy/).
5
+
6
+ The version of the OpenAPI document: 2.0
7
+ Contact: support@launchdarkly.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LaunchDarklyApi
17
+ class GenerateTrustPolicyPostRep
18
+ attr_accessor :aws_trust_policy
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'aws_trust_policy' => :'awsTrustPolicy'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'aws_trust_policy' => :'TrustPolicyDetails'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LaunchDarklyApi::GenerateTrustPolicyPostRep` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LaunchDarklyApi::GenerateTrustPolicyPostRep`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'aws_trust_policy')
67
+ self.aws_trust_policy = attributes[:'aws_trust_policy']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ aws_trust_policy == o.aws_trust_policy
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [aws_trust_policy].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def self._deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = LaunchDarklyApi.const_get(type)
168
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -73,6 +73,28 @@ module LaunchDarklyApi
73
73
 
74
74
  attr_accessor :covariance_info
75
75
 
76
+ class EnumAttributeValidator
77
+ attr_reader :datatype
78
+ attr_reader :allowable_values
79
+
80
+ def initialize(datatype, allowable_values)
81
+ @allowable_values = allowable_values.map do |value|
82
+ case datatype.to_s
83
+ when /Integer/i
84
+ value.to_i
85
+ when /Float/i
86
+ value.to_f
87
+ else
88
+ value
89
+ end
90
+ end
91
+ end
92
+
93
+ def valid?(value)
94
+ !value || allowable_values.include?(value)
95
+ end
96
+ end
97
+
76
98
  # Attribute mapping from ruby-style variable name to JSON key.
77
99
  def self.attribute_map
78
100
  {
@@ -292,6 +314,8 @@ module LaunchDarklyApi
292
314
  warn '[DEPRECATED] the `valid?` method is obsolete'
293
315
  return false if @hypothesis.nil?
294
316
  return false if @status.nil?
317
+ status_validator = EnumAttributeValidator.new('String', ["not_started", "running", "stopped"])
318
+ return false unless status_validator.valid?(@status)
295
319
  return false if @created_at.nil?
296
320
  true
297
321
  end
@@ -306,13 +330,13 @@ module LaunchDarklyApi
306
330
  @hypothesis = hypothesis
307
331
  end
308
332
 
309
- # Custom attribute writer method with validation
310
- # @param [Object] status Value to be assigned
333
+ # Custom attribute writer method checking allowed values (enum).
334
+ # @param [Object] status Object to be assigned
311
335
  def status=(status)
312
- if status.nil?
313
- fail ArgumentError, 'status cannot be nil'
336
+ validator = EnumAttributeValidator.new('String', ["not_started", "running", "stopped"])
337
+ unless validator.valid?(status)
338
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
314
339
  end
315
-
316
340
  @status = status
317
341
  end
318
342
 
@@ -77,6 +77,8 @@ module LaunchDarklyApi
77
77
 
78
78
  if attributes.key?(:'key')
79
79
  self.key = attributes[:'key']
80
+ else
81
+ self.key = nil
80
82
  end
81
83
 
82
84
  if attributes.key?(:'environment_key')
@@ -97,6 +99,10 @@ module LaunchDarklyApi
97
99
  def list_invalid_properties
98
100
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
101
  invalid_properties = Array.new
102
+ if @key.nil?
103
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
104
+ end
105
+
100
106
  invalid_properties
101
107
  end
102
108
 
@@ -104,9 +110,20 @@ module LaunchDarklyApi
104
110
  # @return true if the model is valid
105
111
  def valid?
106
112
  warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @key.nil?
107
114
  true
108
115
  end
109
116
 
117
+ # Custom attribute writer method with validation
118
+ # @param [Object] key Value to be assigned
119
+ def key=(key)
120
+ if key.nil?
121
+ fail ArgumentError, 'key cannot be nil'
122
+ end
123
+
124
+ @key = key
125
+ end
126
+
110
127
  # Checks equality by comparing each attribute.
111
128
  # @param [Object] Object to be compared
112
129
  def ==(o)