launchdarkly_api 2.0.3 → 2.0.10
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.
- checksums.yaml +5 -5
- data/README.md +83 -92
- data/docs/CustomProperties.md +7 -0
- data/docs/CustomProperty.md +9 -0
- data/docs/CustomPropertyValues.md +7 -0
- data/docs/Environment.md +1 -0
- data/docs/{EnvironmentBody.md → EnvironmentPost.md} +1 -1
- data/docs/EnvironmentsApi.md +2 -2
- data/docs/FeatureFlag.md +2 -0
- data/docs/FeatureFlagBody.md +1 -0
- data/docs/FeatureFlagConfig.md +1 -0
- data/docs/FeatureFlagStatus.md +1 -1
- data/docs/FeatureFlagsApi.md +8 -3
- data/docs/Project.md +1 -0
- data/docs/ProjectBody.md +1 -0
- data/docs/Rule.md +1 -0
- data/docs/UserFlagSettings.md +1 -1
- data/launchdarkly_api.gemspec +2 -2
- data/lib/launchdarkly_api.rb +5 -2
- data/lib/launchdarkly_api/api/audit_log_api.rb +1 -1
- data/lib/launchdarkly_api/api/custom_roles_api.rb +1 -1
- data/lib/launchdarkly_api/api/environments_api.rb +1 -1
- data/lib/launchdarkly_api/api/feature_flags_api.rb +10 -6
- data/lib/launchdarkly_api/api/projects_api.rb +1 -1
- data/lib/launchdarkly_api/api/root_api.rb +1 -1
- data/lib/launchdarkly_api/api/team_members_api.rb +1 -1
- data/lib/launchdarkly_api/api/user_segments_api.rb +1 -1
- data/lib/launchdarkly_api/api/user_settings_api.rb +1 -1
- data/lib/launchdarkly_api/api/users_api.rb +1 -1
- data/lib/launchdarkly_api/api/webhooks_api.rb +1 -1
- data/lib/launchdarkly_api/api_client.rb +1 -1
- data/lib/launchdarkly_api/api_error.rb +1 -1
- data/lib/launchdarkly_api/configuration.rb +1 -1
- data/lib/launchdarkly_api/models/action.rb +1 -1
- data/lib/launchdarkly_api/models/actions.rb +1 -1
- data/lib/launchdarkly_api/models/audit_log_entries.rb +1 -1
- data/lib/launchdarkly_api/models/audit_log_entry.rb +1 -1
- data/lib/launchdarkly_api/models/audit_log_entry_target.rb +1 -1
- data/lib/launchdarkly_api/models/clause.rb +1 -1
- data/lib/launchdarkly_api/models/custom_properties.rb +179 -0
- data/lib/launchdarkly_api/models/custom_property.rb +203 -0
- data/lib/launchdarkly_api/models/custom_property_values.rb +179 -0
- data/lib/launchdarkly_api/models/custom_role.rb +1 -1
- data/lib/launchdarkly_api/models/custom_role_body.rb +1 -1
- data/lib/launchdarkly_api/models/custom_role_key_or_id.rb +1 -1
- data/lib/launchdarkly_api/models/custom_roles.rb +1 -1
- data/lib/launchdarkly_api/models/environment.rb +17 -5
- data/lib/launchdarkly_api/models/{environment_body.rb → environment_post.rb} +2 -2
- data/lib/launchdarkly_api/models/fallthrough.rb +1 -1
- data/lib/launchdarkly_api/models/feature_flag.rb +20 -2
- data/lib/launchdarkly_api/models/feature_flag_body.rb +12 -2
- data/lib/launchdarkly_api/models/feature_flag_config.rb +13 -2
- data/lib/launchdarkly_api/models/feature_flag_status.rb +2 -2
- data/lib/launchdarkly_api/models/feature_flag_statuses.rb +1 -1
- data/lib/launchdarkly_api/models/feature_flags.rb +1 -1
- data/lib/launchdarkly_api/models/id.rb +1 -1
- data/lib/launchdarkly_api/models/link.rb +1 -1
- data/lib/launchdarkly_api/models/links.rb +1 -1
- data/lib/launchdarkly_api/models/member.rb +1 -1
- data/lib/launchdarkly_api/models/members.rb +1 -1
- data/lib/launchdarkly_api/models/members_body.rb +1 -1
- data/lib/launchdarkly_api/models/patch_comment.rb +1 -1
- data/lib/launchdarkly_api/models/patch_operation.rb +1 -1
- data/lib/launchdarkly_api/models/policy.rb +1 -1
- data/lib/launchdarkly_api/models/prerequisite.rb +1 -1
- data/lib/launchdarkly_api/models/project.rb +17 -5
- data/lib/launchdarkly_api/models/project_body.rb +16 -5
- data/lib/launchdarkly_api/models/projects.rb +1 -1
- data/lib/launchdarkly_api/models/resource.rb +1 -1
- data/lib/launchdarkly_api/models/resources.rb +1 -1
- data/lib/launchdarkly_api/models/role.rb +1 -1
- data/lib/launchdarkly_api/models/rollout.rb +1 -1
- data/lib/launchdarkly_api/models/rule.rb +11 -2
- data/lib/launchdarkly_api/models/statement.rb +1 -1
- data/lib/launchdarkly_api/models/statements.rb +1 -1
- data/lib/launchdarkly_api/models/target.rb +1 -1
- data/lib/launchdarkly_api/models/user.rb +1 -1
- data/lib/launchdarkly_api/models/user_flag_setting.rb +1 -1
- data/lib/launchdarkly_api/models/user_flag_settings.rb +5 -3
- data/lib/launchdarkly_api/models/user_record.rb +1 -1
- data/lib/launchdarkly_api/models/user_segment.rb +1 -1
- data/lib/launchdarkly_api/models/user_segment_body.rb +1 -1
- data/lib/launchdarkly_api/models/user_segment_rule.rb +1 -1
- data/lib/launchdarkly_api/models/user_segments.rb +1 -1
- data/lib/launchdarkly_api/models/user_settings_body.rb +1 -1
- data/lib/launchdarkly_api/models/users.rb +1 -1
- data/lib/launchdarkly_api/models/variation.rb +1 -1
- data/lib/launchdarkly_api/models/webhook.rb +1 -1
- data/lib/launchdarkly_api/models/webhook_body.rb +1 -1
- data/lib/launchdarkly_api/models/webhooks.rb +1 -1
- data/lib/launchdarkly_api/models/weighted_variation.rb +1 -1
- data/lib/launchdarkly_api/version.rb +2 -2
- data/openapi.yml +2082 -0
- data/spec/api/audit_log_api_spec.rb +1 -1
- data/spec/api/custom_roles_api_spec.rb +1 -1
- data/spec/api/environments_api_spec.rb +1 -1
- data/spec/api/feature_flags_api_spec.rb +3 -2
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/root_api_spec.rb +1 -1
- data/spec/api/team_members_api_spec.rb +1 -1
- data/spec/api/user_segments_api_spec.rb +1 -1
- data/spec/api/user_settings_api_spec.rb +1 -1
- data/spec/api/users_api_spec.rb +1 -1
- data/spec/api/webhooks_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/action_spec.rb +1 -1
- data/spec/models/actions_spec.rb +1 -1
- data/spec/models/audit_log_entries_spec.rb +1 -1
- data/spec/models/audit_log_entry_spec.rb +1 -1
- data/spec/models/audit_log_entry_target_spec.rb +1 -1
- data/spec/models/clause_spec.rb +1 -1
- data/spec/models/custom_properties_spec.rb +36 -0
- data/spec/models/custom_property_spec.rb +48 -0
- data/spec/models/custom_property_values_spec.rb +36 -0
- data/spec/models/custom_role_body_spec.rb +1 -1
- data/spec/models/custom_role_key_or_id_spec.rb +1 -1
- data/spec/models/custom_role_spec.rb +1 -1
- data/spec/models/custom_roles_spec.rb +1 -1
- data/spec/models/{environment_body_spec.rb → environment_post_spec.rb} +7 -7
- data/spec/models/environment_spec.rb +7 -1
- data/spec/models/fallthrough_spec.rb +1 -1
- data/spec/models/feature_flag_body_spec.rb +7 -1
- data/spec/models/feature_flag_config_spec.rb +7 -1
- data/spec/models/feature_flag_spec.rb +13 -1
- data/spec/models/feature_flag_status_spec.rb +1 -1
- data/spec/models/feature_flag_statuses_spec.rb +1 -1
- data/spec/models/feature_flags_spec.rb +1 -1
- data/spec/models/id_spec.rb +1 -1
- data/spec/models/link_spec.rb +1 -1
- data/spec/models/links_spec.rb +1 -1
- data/spec/models/member_spec.rb +1 -1
- data/spec/models/members_body_spec.rb +1 -1
- data/spec/models/members_spec.rb +1 -1
- data/spec/models/patch_comment_spec.rb +1 -1
- data/spec/models/patch_operation_spec.rb +1 -1
- data/spec/models/policy_spec.rb +1 -1
- data/spec/models/prerequisite_spec.rb +1 -1
- data/spec/models/project_body_spec.rb +7 -1
- data/spec/models/project_spec.rb +7 -1
- data/spec/models/projects_spec.rb +1 -1
- data/spec/models/resource_spec.rb +1 -1
- data/spec/models/resources_spec.rb +1 -1
- data/spec/models/role_spec.rb +1 -1
- data/spec/models/rollout_spec.rb +1 -1
- data/spec/models/rule_spec.rb +7 -1
- data/spec/models/statement_spec.rb +1 -1
- data/spec/models/statements_spec.rb +1 -1
- data/spec/models/target_spec.rb +1 -1
- data/spec/models/user_flag_setting_spec.rb +1 -1
- data/spec/models/user_flag_settings_spec.rb +1 -1
- data/spec/models/user_record_spec.rb +1 -1
- data/spec/models/user_segment_body_spec.rb +1 -1
- data/spec/models/user_segment_rule_spec.rb +1 -1
- data/spec/models/user_segment_spec.rb +1 -1
- data/spec/models/user_segments_spec.rb +1 -1
- data/spec/models/user_settings_body_spec.rb +1 -1
- data/spec/models/user_spec.rb +1 -1
- data/spec/models/users_spec.rb +1 -1
- data/spec/models/variation_spec.rb +1 -1
- data/spec/models/webhook_body_spec.rb +1 -1
- data/spec/models/webhook_spec.rb +1 -1
- data/spec/models/webhooks_spec.rb +1 -1
- data/spec/models/weighted_variation_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +69 -61
- data/Gemfile.lock +0 -69
- data/launchdarkly_api-2.0.2.gem +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/swagger_client/.DS_Store +0 -0
- data/test.rb +0 -50
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 58e814db548b96f9a785ab3fbb27e271dc7a142d6ef0752557f5d3c1c7c34469
|
|
4
|
+
data.tar.gz: 8f005f60dbf6b3d412a894dcada747aab5b693a1e151d115bc6bb094d9a36a58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c2f5a59e56c92a4d7f4249839aa0dbe1353eb79dfc9ea81637a4d34afa12463369b179ba4b50ff6eefcaa0c5913a94bee2571847078f60368efb5cf2ea166ca
|
|
7
|
+
data.tar.gz: 2bf44a75f0f1f99b7fb872538dadd878dd31b11352b43118edc271871d7cc9761650770691a777417a5501209427ff4899fed3c8605a6e04def2794795b62f3e
|
data/README.md
CHANGED
|
@@ -1,142 +1,89 @@
|
|
|
1
1
|
This repository contains a client library for LaunchDarkly's REST API. This client was automatically
|
|
2
2
|
generated from our [OpenAPI specification](https://github.com/launchdarkly/ld-openapi).
|
|
3
3
|
|
|
4
|
-
This REST API is for custom integrations, data export, or automating your feature flag workflows. *DO NOT* use this client library to
|
|
4
|
+
This REST API is for custom integrations, data export, or automating your feature flag workflows. *DO NOT* use this client library to include feature flags in your web or mobile application. To integrate feature flags with your application, please see the [SDK documentation](https://docs.launchdarkly.com/v2.0/docs)
|
|
5
5
|
|
|
6
6
|
# launchdarkly_api
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
LaunchDarklyApi - the Ruby gem for the LaunchDarkly REST API
|
|
9
9
|
|
|
10
10
|
Build custom integrations with the LaunchDarkly REST API
|
|
11
11
|
|
|
12
12
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
|
13
13
|
|
|
14
|
-
- API version: 2.0.
|
|
15
|
-
- Package version:
|
|
14
|
+
- API version: 2.0.10
|
|
15
|
+
- Package version: 2.0.10
|
|
16
16
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
|
17
17
|
For more information, please visit [https://support.launchdarkly.com](https://support.launchdarkly.com)
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### Build a gem
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Add this to your Gemfile:
|
|
26
|
-
|
|
27
|
-
gem 'launchdarkly_api', '~> VERSION'
|
|
28
|
-
|
|
29
|
-
### To use source code from Git
|
|
30
|
-
|
|
31
|
-
Use this method if you want to use an alternate branch or a fork from Git. Add the following in the Gemfile:
|
|
32
|
-
|
|
33
|
-
gem 'launchdarkly_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
|
34
|
-
|
|
35
|
-
### To build the gem locally
|
|
36
|
-
|
|
37
|
-
Check out the source code, then build it:
|
|
23
|
+
To build the Ruby code into a gem:
|
|
38
24
|
|
|
39
25
|
```shell
|
|
40
26
|
gem build launchdarkly_api.gemspec
|
|
41
27
|
```
|
|
42
28
|
|
|
43
|
-
Then install the gem locally:
|
|
29
|
+
Then either install the gem locally:
|
|
44
30
|
|
|
45
31
|
```shell
|
|
46
|
-
gem install ./
|
|
47
|
-
# To include development dependencies, use gem install --dev
|
|
32
|
+
gem install ./launchdarkly_api-2.0.10.gem
|
|
48
33
|
```
|
|
34
|
+
(for development, run `gem install --dev ./launchdarkly_api-2.0.10.gem` to install the development dependencies)
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
gem 'launchdarkly_api', '~> VERSION'
|
|
53
|
-
|
|
54
|
-
## Usage examples
|
|
36
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
55
37
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```ruby
|
|
59
|
-
require 'launchdarkly_api'
|
|
60
|
-
|
|
61
|
-
api_key = 'put a valid API key for your account here'
|
|
62
|
-
project_key = 'put the key of your project here'
|
|
63
|
-
flag_key = 'put the key of a feature flag here'
|
|
64
|
-
|
|
65
|
-
LaunchDarklyApi.configure do |config|
|
|
66
|
-
config.api_key['Authorization'] = api_key
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
flag_api = LaunchDarklyApi::FeatureFlagsApi.new
|
|
70
|
-
|
|
71
|
-
begin
|
|
72
|
-
flag = flag_api.get_feature_flag(project_key, flag_key)
|
|
73
|
-
puts "Flag key: #{flag_key}, name: #{flag.name}, description: #{flag.description}"
|
|
74
|
-
rescue LaunchDarklyApi::ApiError => e
|
|
75
|
-
puts "API returned error: #{e.message} #{e.response_body}"
|
|
76
|
-
end
|
|
77
|
-
```
|
|
38
|
+
Finally add this to the Gemfile:
|
|
78
39
|
|
|
79
|
-
|
|
40
|
+
gem 'launchdarkly_api', '~> 2.0.10'
|
|
80
41
|
|
|
81
|
-
|
|
82
|
-
require 'launchdarkly_api'
|
|
42
|
+
### Install from Git
|
|
83
43
|
|
|
84
|
-
|
|
85
|
-
project_key = 'put the key of your project here'
|
|
86
|
-
environment_key = 'the key of the environment where you want to change the flag'
|
|
87
|
-
flag_key = 'put the key of a feature flag here'
|
|
44
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
|
88
45
|
|
|
89
|
-
|
|
90
|
-
config.api_key['Authorization'] = api_key
|
|
91
|
-
end
|
|
46
|
+
gem 'launchdarkly_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
|
92
47
|
|
|
93
|
-
|
|
48
|
+
### Include the Ruby code directly
|
|
94
49
|
|
|
95
|
-
|
|
96
|
-
# Properties are modified with JSON Patch syntax - http://jsonpatch.com/
|
|
97
|
-
# Note that all environment-specific properties have a path prefix that includes the environment key.
|
|
98
|
-
property_path = "/environments/#{environment_key}/on"
|
|
99
|
-
new_value = true
|
|
100
|
-
patches = [ LaunchDarklyApi::PatchOperation.new(op: 'replace', path: property_path, value: new_value) ]
|
|
101
|
-
patch_and_comment = LaunchDarklyApi::PatchComment.new(patch: patches, comment: 'turning flag on')
|
|
50
|
+
Include the Ruby code directly using `-I` as follows:
|
|
102
51
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
rescue LaunchDarklyApi::ApiError => e
|
|
106
|
-
puts "API returned error: #{e.message} #{e.response_body}"
|
|
107
|
-
end
|
|
52
|
+
```shell
|
|
53
|
+
ruby -Ilib script.rb
|
|
108
54
|
```
|
|
109
55
|
|
|
110
|
-
|
|
56
|
+
## Getting Started
|
|
111
57
|
|
|
58
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
|
112
59
|
```ruby
|
|
113
60
|
# Load the gem
|
|
114
61
|
require 'launchdarkly_api'
|
|
115
62
|
|
|
116
|
-
|
|
117
|
-
|
|
63
|
+
# Setup authorization
|
|
118
64
|
LaunchDarklyApi.configure do |config|
|
|
119
|
-
|
|
65
|
+
# Configure API key authorization: Token
|
|
66
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
67
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
68
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
|
120
69
|
end
|
|
121
70
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
current_time_millis = (Time.now.to_f * 1000).to_i
|
|
125
|
-
one_hour_ago = current_time_millis - (60 * 60 * 1000)
|
|
71
|
+
api_instance = LaunchDarklyApi::AuditLogApi.new
|
|
126
72
|
|
|
127
|
-
opts = {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
73
|
+
opts = {
|
|
74
|
+
before: 8.14, # Float | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.
|
|
75
|
+
after: 8.14, # Float | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occured after this timestamp.
|
|
76
|
+
q: "q_example", # String | Text to search for. You can search for the full or partial name of the resource involved or fullpartial email address of the member who made the change.
|
|
77
|
+
limit: 8.14, # Float | A limit on the number of audit log entries to be returned, between 1 and 20.
|
|
78
|
+
spec: "spec_example" # String | A resource specifier, allowing you to filter audit log listings by resource.
|
|
79
|
+
}
|
|
131
80
|
|
|
132
81
|
begin
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
result
|
|
136
|
-
puts item.title
|
|
137
|
-
}
|
|
82
|
+
#Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.
|
|
83
|
+
result = api_instance.get_audit_log_entries(opts)
|
|
84
|
+
p result
|
|
138
85
|
rescue LaunchDarklyApi::ApiError => e
|
|
139
|
-
puts "
|
|
86
|
+
puts "Exception when calling AuditLogApi->get_audit_log_entries: #{e}"
|
|
140
87
|
end
|
|
141
88
|
|
|
142
89
|
```
|
|
@@ -203,12 +150,15 @@ Class | Method | HTTP request | Description
|
|
|
203
150
|
- [LaunchDarklyApi::AuditLogEntry](docs/AuditLogEntry.md)
|
|
204
151
|
- [LaunchDarklyApi::AuditLogEntryTarget](docs/AuditLogEntryTarget.md)
|
|
205
152
|
- [LaunchDarklyApi::Clause](docs/Clause.md)
|
|
153
|
+
- [LaunchDarklyApi::CustomProperties](docs/CustomProperties.md)
|
|
154
|
+
- [LaunchDarklyApi::CustomProperty](docs/CustomProperty.md)
|
|
155
|
+
- [LaunchDarklyApi::CustomPropertyValues](docs/CustomPropertyValues.md)
|
|
206
156
|
- [LaunchDarklyApi::CustomRole](docs/CustomRole.md)
|
|
207
157
|
- [LaunchDarklyApi::CustomRoleBody](docs/CustomRoleBody.md)
|
|
208
158
|
- [LaunchDarklyApi::CustomRoleKeyOrId](docs/CustomRoleKeyOrId.md)
|
|
209
159
|
- [LaunchDarklyApi::CustomRoles](docs/CustomRoles.md)
|
|
210
160
|
- [LaunchDarklyApi::Environment](docs/Environment.md)
|
|
211
|
-
- [LaunchDarklyApi::
|
|
161
|
+
- [LaunchDarklyApi::EnvironmentPost](docs/EnvironmentPost.md)
|
|
212
162
|
- [LaunchDarklyApi::Fallthrough](docs/Fallthrough.md)
|
|
213
163
|
- [LaunchDarklyApi::FeatureFlag](docs/FeatureFlag.md)
|
|
214
164
|
- [LaunchDarklyApi::FeatureFlagBody](docs/FeatureFlagBody.md)
|
|
@@ -262,3 +212,44 @@ Class | Method | HTTP request | Description
|
|
|
262
212
|
- **Type**: API key
|
|
263
213
|
- **API key parameter name**: Authorization
|
|
264
214
|
- **Location**: HTTP header
|
|
215
|
+
|
|
216
|
+
## Sample Code
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
# Load the gem
|
|
220
|
+
require 'launchdarkly_api'
|
|
221
|
+
|
|
222
|
+
# Setup authorization
|
|
223
|
+
LaunchDarklyApi.configure do |config|
|
|
224
|
+
config.api_key['Authorization'] = ENV['LD_API_KEY']
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
api_instance = LaunchDarklyApi::FeatureFlagsApi.new
|
|
228
|
+
|
|
229
|
+
project_key = "openapi"
|
|
230
|
+
flag_key = "test-ruby"
|
|
231
|
+
|
|
232
|
+
# Create a flag with a json variations
|
|
233
|
+
body = LaunchDarklyApi::FeatureFlagBody.new(
|
|
234
|
+
name: "test-ruby",
|
|
235
|
+
key: flag_key,
|
|
236
|
+
variations: [
|
|
237
|
+
LaunchDarklyApi::Variation.new(value=[1,2]),
|
|
238
|
+
LaunchDarklyApi::Variation.new(value=[3,4]),
|
|
239
|
+
LaunchDarklyApi::Variation.new(value=[5]),
|
|
240
|
+
])
|
|
241
|
+
|
|
242
|
+
begin
|
|
243
|
+
result = api_instance.post_feature_flag(project_key, body)
|
|
244
|
+
p result
|
|
245
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
246
|
+
puts "Exception creating feature flag: #{e}"
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Clean up new flag
|
|
250
|
+
begin
|
|
251
|
+
result = api_instance.delete_feature_flag(project_key, flag_key)
|
|
252
|
+
p result
|
|
253
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
254
|
+
puts "Exception deleting feature flag: #{e}"
|
|
255
|
+
end```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# LaunchDarklyApi::CustomProperty
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**name** | **String** | The name of the property. |
|
|
7
|
+
**value** | [**CustomPropertyValues**](CustomPropertyValues.md) | | [optional]
|
|
8
|
+
|
|
9
|
+
|
data/docs/Environment.md
CHANGED
|
@@ -13,5 +13,6 @@ Name | Type | Description | Notes
|
|
|
13
13
|
**default_ttl** | **Float** | The default TTL. | [optional]
|
|
14
14
|
**secure_mode** | **BOOLEAN** | Determines if this environment is in safe mode. | [optional]
|
|
15
15
|
**default_track_events** | **BOOLEAN** | Set to true to send detailed event information for new flags. | [optional]
|
|
16
|
+
**tags** | **Array<String>** | An array of tags for this environment. | [optional]
|
|
16
17
|
|
|
17
18
|
|
data/docs/EnvironmentsApi.md
CHANGED
|
@@ -198,7 +198,7 @@ api_instance = LaunchDarklyApi::EnvironmentsApi.new
|
|
|
198
198
|
|
|
199
199
|
project_key = "project_key_example" # String | The project key, used to tie the flags together under one project so they can be managed together.
|
|
200
200
|
|
|
201
|
-
environment_body = LaunchDarklyApi::
|
|
201
|
+
environment_body = LaunchDarklyApi::EnvironmentPost.new # EnvironmentPost | New environment.
|
|
202
202
|
|
|
203
203
|
|
|
204
204
|
begin
|
|
@@ -214,7 +214,7 @@ end
|
|
|
214
214
|
Name | Type | Description | Notes
|
|
215
215
|
------------- | ------------- | ------------- | -------------
|
|
216
216
|
**project_key** | **String**| The project key, used to tie the flags together under one project so they can be managed together. |
|
|
217
|
-
**environment_body** | [**
|
|
217
|
+
**environment_body** | [**EnvironmentPost**](EnvironmentPost.md)| New environment. |
|
|
218
218
|
|
|
219
219
|
### Return type
|
|
220
220
|
|
data/docs/FeatureFlag.md
CHANGED
|
@@ -13,6 +13,8 @@ Name | Type | Description | Notes
|
|
|
13
13
|
**maintainer_id** | **String** | The ID of the member that should maintain this flag. | [optional]
|
|
14
14
|
**tags** | **Array<String>** | An array of tags for this feature flag. | [optional]
|
|
15
15
|
**variations** | [**Array<Variation>**](Variation.md) | The variations for this feature flag. | [optional]
|
|
16
|
+
**_version** | **Integer** | | [optional]
|
|
17
|
+
**custom_properties** | [**CustomProperties**](CustomProperties.md) | | [optional]
|
|
16
18
|
**_links** | [**Links**](Links.md) | | [optional]
|
|
17
19
|
**_maintainer** | [**Member**](Member.md) | | [optional]
|
|
18
20
|
**environments** | [**Hash<String, FeatureFlagConfig>**](FeatureFlagConfig.md) | | [optional]
|
data/docs/FeatureFlagBody.md
CHANGED
|
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
|
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
6
|
**name** | **String** | A human-friendly name for the feature flag. Remember to note if this flag is intended to be temporary or permanent. |
|
|
7
7
|
**key** | **String** | A unique key that will be used to reference the flag in your code. |
|
|
8
|
+
**description** | **String** | A description of the feature flag. | [optional]
|
|
8
9
|
**variations** | [**Array<Variation>**](Variation.md) | An array of possible variations for the flag. |
|
|
9
10
|
**temporary** | **BOOLEAN** | Whether or not the flag is a temporary flag. | [optional]
|
|
10
11
|
**tags** | **Array<String>** | Tags for the feature flag. | [optional]
|
data/docs/FeatureFlagConfig.md
CHANGED
|
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
|
10
10
|
**last_modified** | **Integer** | | [optional]
|
|
11
11
|
**version** | **Integer** | | [optional]
|
|
12
12
|
**targets** | [**Array<Target>**](Target.md) | | [optional]
|
|
13
|
+
**goal_ids** | **Array<String>** | | [optional]
|
|
13
14
|
**rules** | [**Array<Rule>**](Rule.md) | | [optional]
|
|
14
15
|
**fallthrough** | [**Fallthrough**](Fallthrough.md) | | [optional]
|
|
15
16
|
**off_variation** | **Integer** | | [optional]
|
data/docs/FeatureFlagStatus.md
CHANGED
|
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
|
|
|
6
6
|
**_links** | [**Links**](Links.md) | | [optional]
|
|
7
7
|
**name** | **String** | | Name | Description | | --------:| ----------- | | new | the feature flag was created within the last 7 days, and has not been requested yet | | active | the feature flag was requested by your servers or clients within the last 7 days | | inactive | the feature flag was created more than 7 days ago, and hasn't been requested by your servers or clients within the past 7 days | | launched | one variation of the feature flag has been rolled out to all your users for at least 7 days | | [optional]
|
|
8
8
|
**last_requested** | **String** | | [optional]
|
|
9
|
-
**default** | **
|
|
9
|
+
**default** | **Object** | | [optional]
|
|
10
10
|
|
|
11
11
|
|
data/docs/FeatureFlagsApi.md
CHANGED
|
@@ -356,7 +356,7 @@ Name | Type | Description | Notes
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
# **post_feature_flag**
|
|
359
|
-
> post_feature_flag(project_key, feature_flag_body)
|
|
359
|
+
> FeatureFlag post_feature_flag(project_key, feature_flag_body, opts)
|
|
360
360
|
|
|
361
361
|
Creates a new feature flag.
|
|
362
362
|
|
|
@@ -378,10 +378,14 @@ project_key = "project_key_example" # String | The project key, used to tie the
|
|
|
378
378
|
|
|
379
379
|
feature_flag_body = LaunchDarklyApi::FeatureFlagBody.new # FeatureFlagBody | Create a new feature flag.
|
|
380
380
|
|
|
381
|
+
opts = {
|
|
382
|
+
clone: "clone_example" # String | The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey will copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag.
|
|
383
|
+
}
|
|
381
384
|
|
|
382
385
|
begin
|
|
383
386
|
#Creates a new feature flag.
|
|
384
|
-
api_instance.post_feature_flag(project_key, feature_flag_body)
|
|
387
|
+
result = api_instance.post_feature_flag(project_key, feature_flag_body, opts)
|
|
388
|
+
p result
|
|
385
389
|
rescue LaunchDarklyApi::ApiError => e
|
|
386
390
|
puts "Exception when calling FeatureFlagsApi->post_feature_flag: #{e}"
|
|
387
391
|
end
|
|
@@ -393,10 +397,11 @@ Name | Type | Description | Notes
|
|
|
393
397
|
------------- | ------------- | ------------- | -------------
|
|
394
398
|
**project_key** | **String**| The project key, used to tie the flags together under one project so they can be managed together. |
|
|
395
399
|
**feature_flag_body** | [**FeatureFlagBody**](FeatureFlagBody.md)| Create a new feature flag. |
|
|
400
|
+
**clone** | **String**| The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey will copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag. | [optional]
|
|
396
401
|
|
|
397
402
|
### Return type
|
|
398
403
|
|
|
399
|
-
|
|
404
|
+
[**FeatureFlag**](FeatureFlag.md)
|
|
400
405
|
|
|
401
406
|
### Authorization
|
|
402
407
|
|
data/docs/Project.md
CHANGED
|
@@ -8,5 +8,6 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**key** | **String** | | [optional]
|
|
9
9
|
**name** | **String** | | [optional]
|
|
10
10
|
**environments** | [**Array<Environment>**](Environment.md) | | [optional]
|
|
11
|
+
**tags** | **Array<String>** | An array of tags for this project. | [optional]
|
|
11
12
|
|
|
12
13
|
|
data/docs/ProjectBody.md
CHANGED
data/docs/Rule.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Properties
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**_id** | **String** | | [optional]
|
|
6
7
|
**variation** | **Integer** | | [optional]
|
|
7
8
|
**rollout** | [**Rollout**](Rollout.md) | | [optional]
|
|
8
9
|
**clauses** | [**Array<Clause>**](Clause.md) | | [optional]
|
data/docs/UserFlagSettings.md
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
6
|
**_links** | [**Links**](Links.md) | | [optional]
|
|
7
|
-
**items** | **
|
|
7
|
+
**items** | [**Hash<String, UserFlagSetting>**](UserFlagSetting.md) | | [optional]
|
|
8
8
|
|
|
9
9
|
|
data/launchdarkly_api.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#Build custom integrations with the LaunchDarkly REST API
|
|
7
7
|
|
|
8
|
-
OpenAPI spec version: 2.0.
|
|
8
|
+
OpenAPI spec version: 2.0.10
|
|
9
9
|
Contact: support@launchdarkly.com
|
|
10
10
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
11
|
Swagger Codegen version: 2.3.1
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.name = "launchdarkly_api"
|
|
20
20
|
s.version = LaunchDarklyApi::VERSION
|
|
21
21
|
s.platform = Gem::Platform::RUBY
|
|
22
|
-
s.authors = ["
|
|
22
|
+
s.authors = ["LaunchDarkly"]
|
|
23
23
|
s.email = ["support@launchdarkly.com"]
|
|
24
24
|
s.homepage = "https://github.com/launchdarkly/api-client-ruby"
|
|
25
25
|
s.summary = "LaunchDarkly REST API Ruby Gem"
|