launchdarkly_api 2.0.3
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 +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/LICENSE.txt +13 -0
- data/README.md +264 -0
- data/Rakefile +8 -0
- data/docs/Action.md +7 -0
- data/docs/Actions.md +7 -0
- data/docs/AuditLogApi.md +123 -0
- data/docs/AuditLogEntries.md +9 -0
- data/docs/AuditLogEntry.md +19 -0
- data/docs/AuditLogEntryTarget.md +10 -0
- data/docs/Clause.md +11 -0
- data/docs/CustomRole.md +13 -0
- data/docs/CustomRoleBody.md +11 -0
- data/docs/CustomRoleKeyOrId.md +7 -0
- data/docs/CustomRoles.md +9 -0
- data/docs/CustomRolesApi.md +268 -0
- data/docs/Environment.md +17 -0
- data/docs/EnvironmentBody.md +11 -0
- data/docs/EnvironmentsApi.md +233 -0
- data/docs/Fallthrough.md +9 -0
- data/docs/FeatureFlag.md +20 -0
- data/docs/FeatureFlagBody.md +13 -0
- data/docs/FeatureFlagConfig.md +19 -0
- data/docs/FeatureFlagStatus.md +11 -0
- data/docs/FeatureFlagStatuses.md +9 -0
- data/docs/FeatureFlags.md +9 -0
- data/docs/FeatureFlagsApi.md +411 -0
- data/docs/Id.md +7 -0
- data/docs/Link.md +9 -0
- data/docs/Links.md +9 -0
- data/docs/Member.md +14 -0
- data/docs/Members.md +9 -0
- data/docs/MembersBody.md +13 -0
- data/docs/PatchComment.md +9 -0
- data/docs/PatchOperation.md +10 -0
- data/docs/Policy.md +10 -0
- data/docs/Prerequisite.md +9 -0
- data/docs/Project.md +12 -0
- data/docs/ProjectBody.md +9 -0
- data/docs/Projects.md +9 -0
- data/docs/ProjectsApi.md +268 -0
- data/docs/Resource.md +7 -0
- data/docs/Resources.md +7 -0
- data/docs/Role.md +7 -0
- data/docs/Rollout.md +8 -0
- data/docs/RootApi.md +56 -0
- data/docs/Rule.md +10 -0
- data/docs/Statement.md +12 -0
- data/docs/Statements.md +7 -0
- data/docs/Target.md +9 -0
- data/docs/TeamMembersApi.md +268 -0
- data/docs/User.md +18 -0
- data/docs/UserFlagSetting.md +10 -0
- data/docs/UserFlagSettings.md +9 -0
- data/docs/UserRecord.md +12 -0
- data/docs/UserSegment.md +17 -0
- data/docs/UserSegmentBody.md +11 -0
- data/docs/UserSegmentRule.md +10 -0
- data/docs/UserSegments.md +9 -0
- data/docs/UserSegmentsApi.md +305 -0
- data/docs/UserSettingsApi.md +193 -0
- data/docs/UserSettingsBody.md +8 -0
- data/docs/Users.md +10 -0
- data/docs/UsersApi.md +255 -0
- data/docs/Variation.md +10 -0
- data/docs/Webhook.md +14 -0
- data/docs/WebhookBody.md +12 -0
- data/docs/Webhooks.md +9 -0
- data/docs/WebhooksApi.md +268 -0
- data/docs/WeightedVariation.md +9 -0
- data/git_push.sh +55 -0
- data/launchdarkly_api-2.0.2.gem +0 -0
- data/launchdarkly_api.gemspec +46 -0
- data/lib/.DS_Store +0 -0
- data/lib/launchdarkly_api/api/audit_log_api.rb +142 -0
- data/lib/launchdarkly_api/api/custom_roles_api.rb +296 -0
- data/lib/launchdarkly_api/api/environments_api.rb +271 -0
- data/lib/launchdarkly_api/api/feature_flags_api.rb +463 -0
- data/lib/launchdarkly_api/api/projects_api.rb +296 -0
- data/lib/launchdarkly_api/api/root_api.rb +72 -0
- data/lib/launchdarkly_api/api/team_members_api.rb +296 -0
- data/lib/launchdarkly_api/api/user_segments_api.rb +359 -0
- data/lib/launchdarkly_api/api/user_settings_api.rb +241 -0
- data/lib/launchdarkly_api/api/users_api.rb +299 -0
- data/lib/launchdarkly_api/api/webhooks_api.rb +296 -0
- data/lib/launchdarkly_api/api_client.rb +389 -0
- data/lib/launchdarkly_api/api_error.rb +38 -0
- data/lib/launchdarkly_api/configuration.rb +209 -0
- data/lib/launchdarkly_api/models/action.rb +179 -0
- data/lib/launchdarkly_api/models/actions.rb +179 -0
- data/lib/launchdarkly_api/models/audit_log_entries.rb +199 -0
- data/lib/launchdarkly_api/models/audit_log_entry.rb +287 -0
- data/lib/launchdarkly_api/models/audit_log_entry_target.rb +208 -0
- data/lib/launchdarkly_api/models/clause.rb +217 -0
- data/lib/launchdarkly_api/models/custom_role.rb +237 -0
- data/lib/launchdarkly_api/models/custom_role_body.rb +234 -0
- data/lib/launchdarkly_api/models/custom_role_key_or_id.rb +179 -0
- data/lib/launchdarkly_api/models/custom_roles.rb +197 -0
- data/lib/launchdarkly_api/models/environment.rb +277 -0
- data/lib/launchdarkly_api/models/environment_body.rb +234 -0
- data/lib/launchdarkly_api/models/fallthrough.rb +197 -0
- data/lib/launchdarkly_api/models/feature_flag.rb +310 -0
- data/lib/launchdarkly_api/models/feature_flag_body.rb +258 -0
- data/lib/launchdarkly_api/models/feature_flag_config.rb +294 -0
- data/lib/launchdarkly_api/models/feature_flag_status.rb +249 -0
- data/lib/launchdarkly_api/models/feature_flag_statuses.rb +199 -0
- data/lib/launchdarkly_api/models/feature_flags.rb +199 -0
- data/lib/launchdarkly_api/models/id.rb +179 -0
- data/lib/launchdarkly_api/models/link.rb +197 -0
- data/lib/launchdarkly_api/models/links.rb +197 -0
- data/lib/launchdarkly_api/models/member.rb +244 -0
- data/lib/launchdarkly_api/models/members.rb +197 -0
- data/lib/launchdarkly_api/models/members_body.rb +240 -0
- data/lib/launchdarkly_api/models/patch_comment.rb +199 -0
- data/lib/launchdarkly_api/models/patch_operation.rb +221 -0
- data/lib/launchdarkly_api/models/policy.rb +207 -0
- data/lib/launchdarkly_api/models/prerequisite.rb +197 -0
- data/lib/launchdarkly_api/models/project.rb +226 -0
- data/lib/launchdarkly_api/models/project_body.rb +207 -0
- data/lib/launchdarkly_api/models/projects.rb +199 -0
- data/lib/launchdarkly_api/models/resource.rb +179 -0
- data/lib/launchdarkly_api/models/resources.rb +179 -0
- data/lib/launchdarkly_api/models/role.rb +33 -0
- data/lib/launchdarkly_api/models/rollout.rb +190 -0
- data/lib/launchdarkly_api/models/rule.rb +208 -0
- data/lib/launchdarkly_api/models/statement.rb +259 -0
- data/lib/launchdarkly_api/models/statements.rb +179 -0
- data/lib/launchdarkly_api/models/target.rb +199 -0
- data/lib/launchdarkly_api/models/user.rb +278 -0
- data/lib/launchdarkly_api/models/user_flag_setting.rb +208 -0
- data/lib/launchdarkly_api/models/user_flag_settings.rb +197 -0
- data/lib/launchdarkly_api/models/user_record.rb +224 -0
- data/lib/launchdarkly_api/models/user_segment.rb +300 -0
- data/lib/launchdarkly_api/models/user_segment_body.rb +231 -0
- data/lib/launchdarkly_api/models/user_segment_rule.rb +208 -0
- data/lib/launchdarkly_api/models/user_segments.rb +199 -0
- data/lib/launchdarkly_api/models/user_settings_body.rb +189 -0
- data/lib/launchdarkly_api/models/users.rb +208 -0
- data/lib/launchdarkly_api/models/variation.rb +211 -0
- data/lib/launchdarkly_api/models/webhook.rb +249 -0
- data/lib/launchdarkly_api/models/webhook_body.rb +244 -0
- data/lib/launchdarkly_api/models/webhooks.rb +199 -0
- data/lib/launchdarkly_api/models/weighted_variation.rb +197 -0
- data/lib/launchdarkly_api/version.rb +15 -0
- data/lib/launchdarkly_api.rb +105 -0
- data/lib/swagger_client/.DS_Store +0 -0
- data/spec/api/audit_log_api_spec.rb +63 -0
- data/spec/api/custom_roles_api_spec.rb +95 -0
- data/spec/api/environments_api_spec.rb +88 -0
- data/spec/api/feature_flags_api_spec.rb +130 -0
- data/spec/api/projects_api_spec.rb +95 -0
- data/spec/api/root_api_spec.rb +46 -0
- data/spec/api/team_members_api_spec.rb +95 -0
- data/spec/api/user_segments_api_spec.rb +106 -0
- data/spec/api/user_settings_api_spec.rb +80 -0
- data/spec/api/users_api_spec.rb +96 -0
- data/spec/api/webhooks_api_spec.rb +95 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +36 -0
- data/spec/models/actions_spec.rb +36 -0
- data/spec/models/audit_log_entries_spec.rb +48 -0
- data/spec/models/audit_log_entry_spec.rb +108 -0
- data/spec/models/audit_log_entry_target_spec.rb +54 -0
- data/spec/models/clause_spec.rb +60 -0
- data/spec/models/custom_role_body_spec.rb +60 -0
- data/spec/models/custom_role_key_or_id_spec.rb +36 -0
- data/spec/models/custom_role_spec.rb +72 -0
- data/spec/models/custom_roles_spec.rb +48 -0
- data/spec/models/environment_body_spec.rb +60 -0
- data/spec/models/environment_spec.rb +96 -0
- data/spec/models/fallthrough_spec.rb +48 -0
- data/spec/models/feature_flag_body_spec.rb +72 -0
- data/spec/models/feature_flag_config_spec.rb +108 -0
- data/spec/models/feature_flag_spec.rb +114 -0
- data/spec/models/feature_flag_status_spec.rb +64 -0
- data/spec/models/feature_flag_statuses_spec.rb +48 -0
- data/spec/models/feature_flags_spec.rb +48 -0
- data/spec/models/id_spec.rb +36 -0
- data/spec/models/link_spec.rb +48 -0
- data/spec/models/links_spec.rb +48 -0
- data/spec/models/member_spec.rb +78 -0
- data/spec/models/members_body_spec.rb +72 -0
- data/spec/models/members_spec.rb +48 -0
- data/spec/models/patch_comment_spec.rb +48 -0
- data/spec/models/patch_operation_spec.rb +54 -0
- data/spec/models/policy_spec.rb +54 -0
- data/spec/models/prerequisite_spec.rb +48 -0
- data/spec/models/project_body_spec.rb +48 -0
- data/spec/models/project_spec.rb +66 -0
- data/spec/models/projects_spec.rb +48 -0
- data/spec/models/resource_spec.rb +36 -0
- data/spec/models/resources_spec.rb +36 -0
- data/spec/models/role_spec.rb +36 -0
- data/spec/models/rollout_spec.rb +42 -0
- data/spec/models/rule_spec.rb +54 -0
- data/spec/models/statement_spec.rb +70 -0
- data/spec/models/statements_spec.rb +36 -0
- data/spec/models/target_spec.rb +48 -0
- data/spec/models/user_flag_setting_spec.rb +54 -0
- data/spec/models/user_flag_settings_spec.rb +48 -0
- data/spec/models/user_record_spec.rb +66 -0
- data/spec/models/user_segment_body_spec.rb +60 -0
- data/spec/models/user_segment_rule_spec.rb +54 -0
- data/spec/models/user_segment_spec.rb +96 -0
- data/spec/models/user_segments_spec.rb +48 -0
- data/spec/models/user_settings_body_spec.rb +42 -0
- data/spec/models/user_spec.rb +102 -0
- data/spec/models/users_spec.rb +54 -0
- data/spec/models/variation_spec.rb +54 -0
- data/spec/models/webhook_body_spec.rb +66 -0
- data/spec/models/webhook_spec.rb +78 -0
- data/spec/models/webhooks_spec.rb +48 -0
- data/spec/models/weighted_variation_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- data/test.rb +50 -0
- metadata +509 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#LaunchDarkly REST API
|
|
3
|
+
|
|
4
|
+
#Build custom integrations with the LaunchDarkly REST API
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 2.0.3
|
|
7
|
+
Contact: support@launchdarkly.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module LaunchDarklyApi
|
|
16
|
+
class EnvironmentsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Delete an environment in a specific project.
|
|
24
|
+
#
|
|
25
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
26
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @return [nil]
|
|
29
|
+
def delete_environment(project_key, environment_key, opts = {})
|
|
30
|
+
delete_environment_with_http_info(project_key, environment_key, opts)
|
|
31
|
+
return nil
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Delete an environment in a specific project.
|
|
35
|
+
#
|
|
36
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
37
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
|
40
|
+
def delete_environment_with_http_info(project_key, environment_key, opts = {})
|
|
41
|
+
if @api_client.config.debugging
|
|
42
|
+
@api_client.config.logger.debug "Calling API: EnvironmentsApi.delete_environment ..."
|
|
43
|
+
end
|
|
44
|
+
# verify the required parameter 'project_key' is set
|
|
45
|
+
if @api_client.config.client_side_validation && project_key.nil?
|
|
46
|
+
fail ArgumentError, "Missing the required parameter 'project_key' when calling EnvironmentsApi.delete_environment"
|
|
47
|
+
end
|
|
48
|
+
# verify the required parameter 'environment_key' is set
|
|
49
|
+
if @api_client.config.client_side_validation && environment_key.nil?
|
|
50
|
+
fail ArgumentError, "Missing the required parameter 'environment_key' when calling EnvironmentsApi.delete_environment"
|
|
51
|
+
end
|
|
52
|
+
# resource path
|
|
53
|
+
local_var_path = "/projects/{projectKey}/environments/{environmentKey}".sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s)
|
|
54
|
+
|
|
55
|
+
# query parameters
|
|
56
|
+
query_params = {}
|
|
57
|
+
|
|
58
|
+
# header parameters
|
|
59
|
+
header_params = {}
|
|
60
|
+
# HTTP header 'Accept' (if needed)
|
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
62
|
+
# HTTP header 'Content-Type'
|
|
63
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
64
|
+
|
|
65
|
+
# form parameters
|
|
66
|
+
form_params = {}
|
|
67
|
+
|
|
68
|
+
# http body (model)
|
|
69
|
+
post_body = nil
|
|
70
|
+
auth_names = ['Token']
|
|
71
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
72
|
+
:header_params => header_params,
|
|
73
|
+
:query_params => query_params,
|
|
74
|
+
:form_params => form_params,
|
|
75
|
+
:body => post_body,
|
|
76
|
+
:auth_names => auth_names)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: EnvironmentsApi#delete_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Get an environment given a project and key.
|
|
84
|
+
#
|
|
85
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
86
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [Environment]
|
|
89
|
+
def get_environment(project_key, environment_key, opts = {})
|
|
90
|
+
data, _status_code, _headers = get_environment_with_http_info(project_key, environment_key, opts)
|
|
91
|
+
return data
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Get an environment given a project and key.
|
|
95
|
+
#
|
|
96
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
97
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @return [Array<(Environment, Fixnum, Hash)>] Environment data, response status code and response headers
|
|
100
|
+
def get_environment_with_http_info(project_key, environment_key, opts = {})
|
|
101
|
+
if @api_client.config.debugging
|
|
102
|
+
@api_client.config.logger.debug "Calling API: EnvironmentsApi.get_environment ..."
|
|
103
|
+
end
|
|
104
|
+
# verify the required parameter 'project_key' is set
|
|
105
|
+
if @api_client.config.client_side_validation && project_key.nil?
|
|
106
|
+
fail ArgumentError, "Missing the required parameter 'project_key' when calling EnvironmentsApi.get_environment"
|
|
107
|
+
end
|
|
108
|
+
# verify the required parameter 'environment_key' is set
|
|
109
|
+
if @api_client.config.client_side_validation && environment_key.nil?
|
|
110
|
+
fail ArgumentError, "Missing the required parameter 'environment_key' when calling EnvironmentsApi.get_environment"
|
|
111
|
+
end
|
|
112
|
+
# resource path
|
|
113
|
+
local_var_path = "/projects/{projectKey}/environments/{environmentKey}".sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s)
|
|
114
|
+
|
|
115
|
+
# query parameters
|
|
116
|
+
query_params = {}
|
|
117
|
+
|
|
118
|
+
# header parameters
|
|
119
|
+
header_params = {}
|
|
120
|
+
# HTTP header 'Accept' (if needed)
|
|
121
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
122
|
+
# HTTP header 'Content-Type'
|
|
123
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
124
|
+
|
|
125
|
+
# form parameters
|
|
126
|
+
form_params = {}
|
|
127
|
+
|
|
128
|
+
# http body (model)
|
|
129
|
+
post_body = nil
|
|
130
|
+
auth_names = ['Token']
|
|
131
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
132
|
+
:header_params => header_params,
|
|
133
|
+
:query_params => query_params,
|
|
134
|
+
:form_params => form_params,
|
|
135
|
+
:body => post_body,
|
|
136
|
+
:auth_names => auth_names,
|
|
137
|
+
:return_type => 'Environment')
|
|
138
|
+
if @api_client.config.debugging
|
|
139
|
+
@api_client.config.logger.debug "API called: EnvironmentsApi#get_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
140
|
+
end
|
|
141
|
+
return data, status_code, headers
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Modify an environment by ID.
|
|
145
|
+
#
|
|
146
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
147
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
148
|
+
# @param patch_delta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'
|
|
149
|
+
# @param [Hash] opts the optional parameters
|
|
150
|
+
# @return [Environment]
|
|
151
|
+
def patch_environment(project_key, environment_key, patch_delta, opts = {})
|
|
152
|
+
data, _status_code, _headers = patch_environment_with_http_info(project_key, environment_key, patch_delta, opts)
|
|
153
|
+
return data
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Modify an environment by ID.
|
|
157
|
+
#
|
|
158
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
159
|
+
# @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
|
|
160
|
+
# @param patch_delta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'
|
|
161
|
+
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @return [Array<(Environment, Fixnum, Hash)>] Environment data, response status code and response headers
|
|
163
|
+
def patch_environment_with_http_info(project_key, environment_key, patch_delta, opts = {})
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "Calling API: EnvironmentsApi.patch_environment ..."
|
|
166
|
+
end
|
|
167
|
+
# verify the required parameter 'project_key' is set
|
|
168
|
+
if @api_client.config.client_side_validation && project_key.nil?
|
|
169
|
+
fail ArgumentError, "Missing the required parameter 'project_key' when calling EnvironmentsApi.patch_environment"
|
|
170
|
+
end
|
|
171
|
+
# verify the required parameter 'environment_key' is set
|
|
172
|
+
if @api_client.config.client_side_validation && environment_key.nil?
|
|
173
|
+
fail ArgumentError, "Missing the required parameter 'environment_key' when calling EnvironmentsApi.patch_environment"
|
|
174
|
+
end
|
|
175
|
+
# verify the required parameter 'patch_delta' is set
|
|
176
|
+
if @api_client.config.client_side_validation && patch_delta.nil?
|
|
177
|
+
fail ArgumentError, "Missing the required parameter 'patch_delta' when calling EnvironmentsApi.patch_environment"
|
|
178
|
+
end
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = "/projects/{projectKey}/environments/{environmentKey}".sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s)
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = {}
|
|
184
|
+
|
|
185
|
+
# header parameters
|
|
186
|
+
header_params = {}
|
|
187
|
+
# HTTP header 'Accept' (if needed)
|
|
188
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
189
|
+
# HTTP header 'Content-Type'
|
|
190
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
191
|
+
|
|
192
|
+
# form parameters
|
|
193
|
+
form_params = {}
|
|
194
|
+
|
|
195
|
+
# http body (model)
|
|
196
|
+
post_body = @api_client.object_to_http_body(patch_delta)
|
|
197
|
+
auth_names = ['Token']
|
|
198
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
|
199
|
+
:header_params => header_params,
|
|
200
|
+
:query_params => query_params,
|
|
201
|
+
:form_params => form_params,
|
|
202
|
+
:body => post_body,
|
|
203
|
+
:auth_names => auth_names,
|
|
204
|
+
:return_type => 'Environment')
|
|
205
|
+
if @api_client.config.debugging
|
|
206
|
+
@api_client.config.logger.debug "API called: EnvironmentsApi#patch_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
207
|
+
end
|
|
208
|
+
return data, status_code, headers
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Create a new environment in a specified project with a given name, key, and swatch color.
|
|
212
|
+
#
|
|
213
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
214
|
+
# @param environment_body New environment.
|
|
215
|
+
# @param [Hash] opts the optional parameters
|
|
216
|
+
# @return [nil]
|
|
217
|
+
def post_environment(project_key, environment_body, opts = {})
|
|
218
|
+
post_environment_with_http_info(project_key, environment_body, opts)
|
|
219
|
+
return nil
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Create a new environment in a specified project with a given name, key, and swatch color.
|
|
223
|
+
#
|
|
224
|
+
# @param project_key The project key, used to tie the flags together under one project so they can be managed together.
|
|
225
|
+
# @param environment_body New environment.
|
|
226
|
+
# @param [Hash] opts the optional parameters
|
|
227
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
|
228
|
+
def post_environment_with_http_info(project_key, environment_body, opts = {})
|
|
229
|
+
if @api_client.config.debugging
|
|
230
|
+
@api_client.config.logger.debug "Calling API: EnvironmentsApi.post_environment ..."
|
|
231
|
+
end
|
|
232
|
+
# verify the required parameter 'project_key' is set
|
|
233
|
+
if @api_client.config.client_side_validation && project_key.nil?
|
|
234
|
+
fail ArgumentError, "Missing the required parameter 'project_key' when calling EnvironmentsApi.post_environment"
|
|
235
|
+
end
|
|
236
|
+
# verify the required parameter 'environment_body' is set
|
|
237
|
+
if @api_client.config.client_side_validation && environment_body.nil?
|
|
238
|
+
fail ArgumentError, "Missing the required parameter 'environment_body' when calling EnvironmentsApi.post_environment"
|
|
239
|
+
end
|
|
240
|
+
# resource path
|
|
241
|
+
local_var_path = "/projects/{projectKey}/environments".sub('{' + 'projectKey' + '}', project_key.to_s)
|
|
242
|
+
|
|
243
|
+
# query parameters
|
|
244
|
+
query_params = {}
|
|
245
|
+
|
|
246
|
+
# header parameters
|
|
247
|
+
header_params = {}
|
|
248
|
+
# HTTP header 'Accept' (if needed)
|
|
249
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
250
|
+
# HTTP header 'Content-Type'
|
|
251
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
252
|
+
|
|
253
|
+
# form parameters
|
|
254
|
+
form_params = {}
|
|
255
|
+
|
|
256
|
+
# http body (model)
|
|
257
|
+
post_body = @api_client.object_to_http_body(environment_body)
|
|
258
|
+
auth_names = ['Token']
|
|
259
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
260
|
+
:header_params => header_params,
|
|
261
|
+
:query_params => query_params,
|
|
262
|
+
:form_params => form_params,
|
|
263
|
+
:body => post_body,
|
|
264
|
+
:auth_names => auth_names)
|
|
265
|
+
if @api_client.config.debugging
|
|
266
|
+
@api_client.config.logger.debug "API called: EnvironmentsApi#post_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
267
|
+
end
|
|
268
|
+
return data, status_code, headers
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
end
|