launchdarkly_api 2.0.10 → 2.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +153 -151
- data/docs/AuditLogApi.md +7 -7
- data/docs/{Action.md → CopyActions.md} +1 -1
- data/docs/CustomProperty.md +1 -1
- data/docs/CustomRole.md +1 -1
- data/docs/CustomRoleBody.md +1 -1
- data/docs/CustomRoles.md +1 -1
- data/docs/CustomRolesApi.md +7 -6
- data/docs/CustomerMetricsApi.md +511 -0
- data/docs/DataExportDestinationsApi.md +293 -0
- data/docs/Destination.md +14 -0
- data/docs/DestinationAmazonKinesis.md +10 -0
- data/docs/DestinationBody.md +11 -0
- data/docs/DestinationGooglePubSub.md +9 -0
- data/docs/DestinationMParticle.md +11 -0
- data/docs/{CustomRoleKeyOrId.md → DestinationSegment.md} +2 -1
- data/docs/Destinations.md +9 -0
- data/docs/Environment.md +2 -0
- data/docs/EnvironmentPost.md +5 -0
- data/docs/EnvironmentsApi.md +11 -10
- data/docs/EvaluationUsageError.md +9 -0
- data/docs/Events.md +8 -0
- data/docs/FeatureFlag.md +4 -1
- data/docs/FeatureFlagConfig.md +0 -1
- data/docs/FeatureFlagCopyBody.md +12 -0
- data/docs/FeatureFlagCopyObject.md +9 -0
- data/docs/FeatureFlagStatus.md +1 -1
- data/docs/FeatureFlagStatusAcrossEnvironments.md +10 -0
- data/docs/FeatureFlagStatusForQueriedEnvironment.md +10 -0
- data/docs/FeatureFlagsApi.md +136 -17
- data/docs/MAU.md +10 -0
- data/docs/{Actions.md → MAUMetadata.md} +1 -1
- data/docs/MAUbyCategory.md +10 -0
- data/docs/Member.md +2 -0
- data/docs/Members.md +1 -1
- data/docs/MembersBody.md +1 -1
- data/docs/Policy.md +4 -2
- data/docs/ProjectBody.md +2 -0
- data/docs/ProjectsApi.md +7 -6
- data/docs/Rollout.md +1 -0
- data/docs/Statement.md +4 -4
- data/docs/Stream.md +10 -0
- data/docs/StreamBySDK.md +10 -0
- data/docs/StreamBySDKLinks.md +9 -0
- data/docs/StreamBySDKLinksMetadata.md +10 -0
- data/docs/StreamLinks.md +10 -0
- data/docs/StreamSDKVersion.md +9 -0
- data/docs/StreamSDKVersionData.md +9 -0
- data/docs/StreamUsageError.md +9 -0
- data/docs/StreamUsageLinks.md +10 -0
- data/docs/StreamUsageMetadata.md +10 -0
- data/docs/StreamUsageSeries.md +9 -0
- data/docs/Streams.md +8 -0
- data/docs/TeamMembersApi.md +7 -6
- data/docs/Usage.md +9 -0
- data/docs/{CustomProperties.md → UsageError.md} +2 -1
- data/docs/UsageLinks.md +10 -0
- data/docs/UserSegmentsApi.md +18 -17
- data/docs/UserSettingsApi.md +11 -11
- data/docs/UsersApi.md +15 -15
- data/docs/Webhook.md +1 -0
- data/docs/WebhookBody.md +2 -0
- data/docs/WebhooksApi.md +7 -6
- data/launchdarkly_api.gemspec +5 -6
- data/lib/launchdarkly_api/api/audit_log_api.rb +13 -19
- data/lib/launchdarkly_api/api/custom_roles_api.rb +23 -37
- data/lib/launchdarkly_api/api/customer_metrics_api.rb +519 -0
- data/lib/launchdarkly_api/api/data_export_destinations_api.rb +330 -0
- data/lib/launchdarkly_api/api/environments_api.rb +20 -31
- data/lib/launchdarkly_api/api/feature_flags_api.rb +150 -43
- data/lib/launchdarkly_api/api/projects_api.rb +23 -37
- data/lib/launchdarkly_api/api/root_api.rb +6 -9
- data/lib/launchdarkly_api/api/team_members_api.rb +23 -37
- data/lib/launchdarkly_api/api/user_segments_api.rb +23 -37
- data/lib/launchdarkly_api/api/user_settings_api.rb +12 -21
- data/lib/launchdarkly_api/api/users_api.rb +17 -29
- data/lib/launchdarkly_api/api/webhooks_api.rb +23 -37
- data/lib/launchdarkly_api/api_client.rb +10 -10
- data/lib/launchdarkly_api/api_error.rb +2 -2
- data/lib/launchdarkly_api/configuration.rb +3 -3
- data/lib/launchdarkly_api/models/audit_log_entries.rb +7 -12
- data/lib/launchdarkly_api/models/audit_log_entry.rb +7 -12
- data/lib/launchdarkly_api/models/audit_log_entry_target.rb +7 -12
- data/lib/launchdarkly_api/models/clause.rb +7 -12
- data/lib/launchdarkly_api/models/copy_actions.rb +34 -0
- data/lib/launchdarkly_api/models/custom_property.rb +13 -14
- data/lib/launchdarkly_api/models/custom_property_values.rb +7 -11
- data/lib/launchdarkly_api/models/custom_role.rb +9 -13
- data/lib/launchdarkly_api/models/custom_role_body.rb +12 -16
- data/lib/launchdarkly_api/models/custom_roles.rb +11 -14
- data/lib/launchdarkly_api/models/destination.rb +276 -0
- data/lib/launchdarkly_api/models/destination_amazon_kinesis.rb +201 -0
- data/lib/launchdarkly_api/models/destination_body.rb +263 -0
- data/lib/launchdarkly_api/models/destination_google_pub_sub.rb +192 -0
- data/lib/launchdarkly_api/models/destination_m_particle.rb +210 -0
- data/lib/launchdarkly_api/models/destination_segment.rb +183 -0
- data/lib/launchdarkly_api/models/destinations.rb +194 -0
- data/lib/launchdarkly_api/models/environment.rb +29 -14
- data/lib/launchdarkly_api/models/environment_post.rb +64 -17
- data/lib/launchdarkly_api/models/evaluation_usage_error.rb +192 -0
- data/lib/launchdarkly_api/models/{action.rb → events.rb} +17 -13
- data/lib/launchdarkly_api/models/fallthrough.rb +7 -12
- data/lib/launchdarkly_api/models/feature_flag.rb +46 -16
- data/lib/launchdarkly_api/models/feature_flag_body.rb +10 -15
- data/lib/launchdarkly_api/models/feature_flag_config.rb +8 -24
- data/lib/launchdarkly_api/models/feature_flag_copy_body.rb +226 -0
- data/lib/launchdarkly_api/models/feature_flag_copy_object.rb +199 -0
- data/lib/launchdarkly_api/models/feature_flag_status.rb +22 -26
- data/lib/launchdarkly_api/models/feature_flag_status_across_environments.rb +203 -0
- data/lib/launchdarkly_api/models/feature_flag_status_for_queried_environment.rb +236 -0
- data/lib/launchdarkly_api/models/feature_flag_statuses.rb +7 -12
- data/lib/launchdarkly_api/models/feature_flags.rb +7 -12
- data/lib/launchdarkly_api/models/id.rb +7 -11
- data/lib/launchdarkly_api/models/link.rb +7 -12
- data/lib/launchdarkly_api/models/links.rb +7 -12
- data/lib/launchdarkly_api/models/ma_uby_category.rb +205 -0
- data/lib/launchdarkly_api/models/mau.rb +205 -0
- data/lib/launchdarkly_api/models/{actions.rb → mau_metadata.rb} +8 -13
- data/lib/launchdarkly_api/models/member.rb +26 -13
- data/lib/launchdarkly_api/models/members.rb +11 -14
- data/lib/launchdarkly_api/models/members_body.rb +9 -14
- data/lib/launchdarkly_api/models/patch_comment.rb +7 -12
- data/lib/launchdarkly_api/models/patch_operation.rb +10 -15
- data/lib/launchdarkly_api/models/policy.rb +40 -17
- data/lib/launchdarkly_api/models/prerequisite.rb +7 -12
- data/lib/launchdarkly_api/models/project.rb +7 -12
- data/lib/launchdarkly_api/models/project_body.rb +30 -15
- data/lib/launchdarkly_api/models/projects.rb +7 -12
- data/lib/launchdarkly_api/models/role.rb +7 -8
- data/lib/launchdarkly_api/models/rollout.rb +17 -13
- data/lib/launchdarkly_api/models/rule.rb +7 -12
- data/lib/launchdarkly_api/models/statement.rb +35 -31
- data/lib/launchdarkly_api/models/statements.rb +7 -12
- data/lib/launchdarkly_api/models/stream.rb +205 -0
- data/lib/launchdarkly_api/models/stream_by_sdk.rb +205 -0
- data/lib/launchdarkly_api/models/stream_by_sdk_links.rb +192 -0
- data/lib/launchdarkly_api/models/{resources.rb → stream_by_sdk_links_metadata.rb} +34 -12
- data/lib/launchdarkly_api/models/stream_links.rb +204 -0
- data/lib/launchdarkly_api/models/stream_sdk_version.rb +194 -0
- data/lib/launchdarkly_api/models/stream_sdk_version_data.rb +194 -0
- data/lib/launchdarkly_api/models/stream_usage_error.rb +192 -0
- data/lib/launchdarkly_api/models/stream_usage_links.rb +204 -0
- data/lib/launchdarkly_api/models/stream_usage_metadata.rb +203 -0
- data/lib/launchdarkly_api/models/stream_usage_series.rb +194 -0
- data/lib/launchdarkly_api/models/{custom_properties.rb → streams.rb} +17 -13
- data/lib/launchdarkly_api/models/target.rb +7 -12
- data/lib/launchdarkly_api/models/usage.rb +194 -0
- data/lib/launchdarkly_api/models/{custom_role_key_or_id.rb → usage_error.rb} +17 -13
- data/lib/launchdarkly_api/models/usage_links.rb +204 -0
- data/lib/launchdarkly_api/models/user.rb +7 -12
- data/lib/launchdarkly_api/models/user_flag_setting.rb +7 -12
- data/lib/launchdarkly_api/models/user_flag_settings.rb +7 -12
- data/lib/launchdarkly_api/models/user_record.rb +7 -12
- data/lib/launchdarkly_api/models/user_segment.rb +10 -15
- data/lib/launchdarkly_api/models/user_segment_body.rb +9 -14
- data/lib/launchdarkly_api/models/user_segment_rule.rb +7 -12
- data/lib/launchdarkly_api/models/user_segments.rb +7 -12
- data/lib/launchdarkly_api/models/user_settings_body.rb +7 -12
- data/lib/launchdarkly_api/models/users.rb +7 -12
- data/lib/launchdarkly_api/models/variation.rb +8 -13
- data/lib/launchdarkly_api/models/webhook.rb +17 -13
- data/lib/launchdarkly_api/models/webhook_body.rb +33 -17
- data/lib/launchdarkly_api/models/webhooks.rb +7 -12
- data/lib/launchdarkly_api/models/weighted_variation.rb +7 -12
- data/lib/launchdarkly_api/version.rb +3 -3
- data/lib/launchdarkly_api.rb +36 -8
- data/openapi.yml +1004 -115
- data/spec/api/audit_log_api_spec.rb +6 -8
- data/spec/api/custom_roles_api_spec.rb +8 -13
- data/spec/api/customer_metrics_api_spec.rb +141 -0
- data/spec/api/data_export_destinations_api_spec.rb +98 -0
- data/spec/api/environments_api_spec.rb +7 -11
- data/spec/api/feature_flags_api_spec.rb +36 -16
- data/spec/api/projects_api_spec.rb +8 -13
- data/spec/api/root_api_spec.rb +3 -4
- data/spec/api/team_members_api_spec.rb +8 -13
- data/spec/api/user_segments_api_spec.rb +8 -13
- data/spec/api/user_settings_api_spec.rb +5 -8
- data/spec/api/users_api_spec.rb +7 -11
- data/spec/api/webhooks_api_spec.rb +8 -13
- data/spec/api_client_spec.rb +36 -36
- data/spec/configuration_spec.rb +10 -10
- data/spec/models/audit_log_entries_spec.rb +4 -5
- data/spec/models/audit_log_entry_spec.rb +14 -15
- data/spec/models/audit_log_entry_target_spec.rb +5 -6
- data/spec/models/clause_spec.rb +6 -7
- data/spec/models/{action_spec.rb → copy_actions_spec.rb} +8 -9
- data/spec/models/custom_property_spec.rb +4 -5
- data/spec/models/custom_property_values_spec.rb +2 -3
- data/spec/models/custom_role_body_spec.rb +6 -7
- data/spec/models/custom_role_spec.rb +8 -9
- data/spec/models/custom_roles_spec.rb +4 -5
- data/spec/models/destination_amazon_kinesis_spec.rb +53 -0
- data/spec/models/destination_body_spec.rb +63 -0
- data/spec/models/destination_google_pub_sub_spec.rb +47 -0
- data/spec/models/destination_m_particle_spec.rb +59 -0
- data/spec/models/destination_segment_spec.rb +41 -0
- data/spec/models/destination_spec.rb +81 -0
- data/spec/models/destinations_spec.rb +47 -0
- data/spec/models/environment_post_spec.rb +36 -7
- data/spec/models/environment_spec.rb +25 -14
- data/spec/models/evaluation_usage_error_spec.rb +47 -0
- data/spec/models/events_spec.rb +41 -0
- data/spec/models/fallthrough_spec.rb +4 -5
- data/spec/models/feature_flag_body_spec.rb +9 -10
- data/spec/models/feature_flag_config_spec.rb +14 -21
- data/spec/models/feature_flag_copy_body_spec.rb +65 -0
- data/spec/models/feature_flag_copy_object_spec.rb +47 -0
- data/spec/models/feature_flag_spec.rb +35 -18
- data/spec/models/feature_flag_status_across_environments_spec.rb +53 -0
- data/spec/models/feature_flag_status_for_queried_environment_spec.rb +57 -0
- data/spec/models/feature_flag_status_spec.rb +14 -15
- data/spec/models/feature_flag_statuses_spec.rb +4 -5
- data/spec/models/feature_flags_spec.rb +4 -5
- data/spec/models/id_spec.rb +2 -3
- data/spec/models/link_spec.rb +4 -5
- data/spec/models/links_spec.rb +4 -5
- data/spec/models/ma_uby_category_spec.rb +53 -0
- data/spec/models/{actions_spec.rb → mau_metadata_spec.rb} +8 -9
- data/spec/models/mau_spec.rb +53 -0
- data/spec/models/member_spec.rb +21 -10
- data/spec/models/members_body_spec.rb +8 -9
- data/spec/models/members_spec.rb +4 -5
- data/spec/models/patch_comment_spec.rb +4 -5
- data/spec/models/patch_operation_spec.rb +5 -6
- data/spec/models/policy_spec.rb +17 -6
- data/spec/models/prerequisite_spec.rb +4 -5
- data/spec/models/project_body_spec.rb +17 -6
- data/spec/models/project_spec.rb +8 -9
- data/spec/models/projects_spec.rb +4 -5
- data/spec/models/role_spec.rb +2 -3
- data/spec/models/rollout_spec.rb +9 -4
- data/spec/models/rule_spec.rb +6 -7
- data/spec/models/statement_spec.rb +13 -14
- data/spec/models/statements_spec.rb +2 -3
- data/spec/models/stream_by_sdk_links_metadata_spec.rb +53 -0
- data/spec/models/stream_by_sdk_links_spec.rb +47 -0
- data/spec/models/stream_by_sdk_spec.rb +53 -0
- data/spec/models/stream_links_spec.rb +53 -0
- data/spec/models/stream_sdk_version_data_spec.rb +47 -0
- data/spec/models/stream_sdk_version_spec.rb +47 -0
- data/spec/models/stream_spec.rb +53 -0
- data/spec/models/stream_usage_error_spec.rb +47 -0
- data/spec/models/stream_usage_links_spec.rb +53 -0
- data/spec/models/stream_usage_metadata_spec.rb +53 -0
- data/spec/models/stream_usage_series_spec.rb +47 -0
- data/spec/models/streams_spec.rb +41 -0
- data/spec/models/target_spec.rb +4 -5
- data/spec/models/usage_error_spec.rb +41 -0
- data/spec/models/usage_links_spec.rb +53 -0
- data/spec/models/usage_spec.rb +47 -0
- data/spec/models/user_flag_setting_spec.rb +5 -6
- data/spec/models/user_flag_settings_spec.rb +4 -5
- data/spec/models/user_record_spec.rb +7 -8
- data/spec/models/user_segment_body_spec.rb +6 -7
- data/spec/models/user_segment_rule_spec.rb +5 -6
- data/spec/models/user_segment_spec.rb +12 -13
- data/spec/models/user_segments_spec.rb +4 -5
- data/spec/models/user_settings_body_spec.rb +3 -4
- data/spec/models/user_spec.rb +13 -14
- data/spec/models/users_spec.rb +5 -6
- data/spec/models/variation_spec.rb +5 -6
- data/spec/models/webhook_body_spec.rb +19 -8
- data/spec/models/webhook_spec.rb +15 -10
- data/spec/models/webhooks_spec.rb +4 -5
- data/spec/models/weighted_variation_spec.rb +4 -5
- data/spec/spec_helper.rb +2 -2
- metadata +187 -74
- data/docs/Resource.md +0 -7
- data/docs/Resources.md +0 -7
- data/lib/launchdarkly_api/models/resource.rb +0 -179
- data/spec/models/custom_properties_spec.rb +0 -36
- data/spec/models/custom_role_key_or_id_spec.rb +0 -36
- data/spec/models/resource_spec.rb +0 -36
- data/spec/models/resources_spec.rb +0 -36
@@ -0,0 +1,263 @@
|
|
1
|
+
=begin
|
2
|
+
#LaunchDarkly REST API
|
3
|
+
|
4
|
+
#Build custom integrations with the LaunchDarkly REST API
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.27
|
7
|
+
Contact: support@launchdarkly.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.8
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module LaunchDarklyApi
|
16
|
+
class DestinationBody
|
17
|
+
# A human-readable name for your data export destination.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# The data export destination type. Available choices are kinesis, google-pubsub, mparticle, or segment.
|
21
|
+
attr_accessor :kind
|
22
|
+
|
23
|
+
# destination-specific configuration.
|
24
|
+
attr_accessor :config
|
25
|
+
|
26
|
+
# Whether the data export destination is on or not.
|
27
|
+
attr_accessor :on
|
28
|
+
|
29
|
+
class EnumAttributeValidator
|
30
|
+
attr_reader :datatype
|
31
|
+
attr_reader :allowable_values
|
32
|
+
|
33
|
+
def initialize(datatype, allowable_values)
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
35
|
+
case datatype.to_s
|
36
|
+
when /Integer/i
|
37
|
+
value.to_i
|
38
|
+
when /Float/i
|
39
|
+
value.to_f
|
40
|
+
else
|
41
|
+
value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def valid?(value)
|
47
|
+
!value || allowable_values.include?(value)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
:'name' => :'name',
|
55
|
+
:'kind' => :'kind',
|
56
|
+
:'config' => :'config',
|
57
|
+
:'on' => :'on'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.swagger_types
|
63
|
+
{
|
64
|
+
:'name' => :'String',
|
65
|
+
:'kind' => :'String',
|
66
|
+
:'config' => :'Object',
|
67
|
+
:'on' => :'BOOLEAN'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
return unless attributes.is_a?(Hash)
|
75
|
+
|
76
|
+
# convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
78
|
+
|
79
|
+
if attributes.has_key?(:'name')
|
80
|
+
self.name = attributes[:'name']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'kind')
|
84
|
+
self.kind = attributes[:'kind']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'config')
|
88
|
+
self.config = attributes[:'config']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'on')
|
92
|
+
self.on = attributes[:'on']
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
97
|
+
# @return Array for valid properties with the reasons
|
98
|
+
def list_invalid_properties
|
99
|
+
invalid_properties = Array.new
|
100
|
+
if @name.nil?
|
101
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @kind.nil?
|
105
|
+
invalid_properties.push('invalid value for "kind", kind cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @config.nil?
|
109
|
+
invalid_properties.push('invalid value for "config", config cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
return false if @name.nil?
|
119
|
+
return false if @kind.nil?
|
120
|
+
kind_validator = EnumAttributeValidator.new('String', ['google-pubsub', 'kinesis', 'mparticle', 'segment'])
|
121
|
+
return false unless kind_validator.valid?(@kind)
|
122
|
+
return false if @config.nil?
|
123
|
+
true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
127
|
+
# @param [Object] kind Object to be assigned
|
128
|
+
def kind=(kind)
|
129
|
+
validator = EnumAttributeValidator.new('String', ['google-pubsub', 'kinesis', 'mparticle', 'segment'])
|
130
|
+
unless validator.valid?(kind)
|
131
|
+
fail ArgumentError, 'invalid value for "kind", must be one of #{validator.allowable_values}.'
|
132
|
+
end
|
133
|
+
@kind = kind
|
134
|
+
end
|
135
|
+
|
136
|
+
# Checks equality by comparing each attribute.
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def ==(o)
|
139
|
+
return true if self.equal?(o)
|
140
|
+
self.class == o.class &&
|
141
|
+
name == o.name &&
|
142
|
+
kind == o.kind &&
|
143
|
+
config == o.config &&
|
144
|
+
on == o.on
|
145
|
+
end
|
146
|
+
|
147
|
+
# @see the `==` method
|
148
|
+
# @param [Object] Object to be compared
|
149
|
+
def eql?(o)
|
150
|
+
self == o
|
151
|
+
end
|
152
|
+
|
153
|
+
# Calculates hash code according to all attributes.
|
154
|
+
# @return [Fixnum] Hash code
|
155
|
+
def hash
|
156
|
+
[name, kind, config, on].hash
|
157
|
+
end
|
158
|
+
|
159
|
+
# Builds the object from hash
|
160
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
161
|
+
# @return [Object] Returns the model itself
|
162
|
+
def build_from_hash(attributes)
|
163
|
+
return nil unless attributes.is_a?(Hash)
|
164
|
+
self.class.swagger_types.each_pair do |key, type|
|
165
|
+
if type =~ /\AArray<(.*)>/i
|
166
|
+
# check to ensure the input is an array given that the the attribute
|
167
|
+
# is documented as an array but the input is not
|
168
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
169
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
170
|
+
end
|
171
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
172
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
173
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
174
|
+
end
|
175
|
+
|
176
|
+
self
|
177
|
+
end
|
178
|
+
|
179
|
+
# Deserializes the data based on type
|
180
|
+
# @param string type Data type
|
181
|
+
# @param string value Value to be deserialized
|
182
|
+
# @return [Object] Deserialized data
|
183
|
+
def _deserialize(type, value)
|
184
|
+
case type.to_sym
|
185
|
+
when :DateTime
|
186
|
+
DateTime.parse(value)
|
187
|
+
when :Date
|
188
|
+
Date.parse(value)
|
189
|
+
when :String
|
190
|
+
value.to_s
|
191
|
+
when :Integer
|
192
|
+
value.to_i
|
193
|
+
when :Float
|
194
|
+
value.to_f
|
195
|
+
when :BOOLEAN
|
196
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
197
|
+
true
|
198
|
+
else
|
199
|
+
false
|
200
|
+
end
|
201
|
+
when :Object
|
202
|
+
# generic object (usually a Hash), return directly
|
203
|
+
value
|
204
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
205
|
+
inner_type = Regexp.last_match[:inner_type]
|
206
|
+
value.map { |v| _deserialize(inner_type, v) }
|
207
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
208
|
+
k_type = Regexp.last_match[:k_type]
|
209
|
+
v_type = Regexp.last_match[:v_type]
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each do |k, v|
|
212
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
else # model
|
216
|
+
temp_model = LaunchDarklyApi.const_get(type).new
|
217
|
+
temp_model.build_from_hash(value)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the string representation of the object
|
222
|
+
# @return [String] String presentation of the object
|
223
|
+
def to_s
|
224
|
+
to_hash.to_s
|
225
|
+
end
|
226
|
+
|
227
|
+
# to_body is an alias to to_hash (backward compatibility)
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
229
|
+
def to_body
|
230
|
+
to_hash
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns the object in the form of hash
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
235
|
+
def to_hash
|
236
|
+
hash = {}
|
237
|
+
self.class.attribute_map.each_pair do |attr, param|
|
238
|
+
value = self.send(attr)
|
239
|
+
next if value.nil?
|
240
|
+
hash[param] = _to_hash(value)
|
241
|
+
end
|
242
|
+
hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Outputs non-array value in the form of hash
|
246
|
+
# For object, use to_hash. Otherwise, just return the value
|
247
|
+
# @param [Object] value Any valid value
|
248
|
+
# @return [Hash] Returns the value in the form of hash
|
249
|
+
def _to_hash(value)
|
250
|
+
if value.is_a?(Array)
|
251
|
+
value.compact.map { |v| _to_hash(v) }
|
252
|
+
elsif value.is_a?(Hash)
|
253
|
+
{}.tap do |hash|
|
254
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
255
|
+
end
|
256
|
+
elsif value.respond_to? :to_hash
|
257
|
+
value.to_hash
|
258
|
+
else
|
259
|
+
value
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
@@ -0,0 +1,192 @@
|
|
1
|
+
=begin
|
2
|
+
#LaunchDarkly REST API
|
3
|
+
|
4
|
+
#Build custom integrations with the LaunchDarkly REST API
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.27
|
7
|
+
Contact: support@launchdarkly.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.8
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module LaunchDarklyApi
|
16
|
+
class DestinationGooglePubSub
|
17
|
+
attr_accessor :project
|
18
|
+
|
19
|
+
attr_accessor :topic
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'project' => :'project',
|
25
|
+
:'topic' => :'topic'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'project' => :'String',
|
33
|
+
:'topic' => :'String'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'project')
|
46
|
+
self.project = attributes[:'project']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.has_key?(:'topic')
|
50
|
+
self.topic = attributes[:'topic']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
55
|
+
# @return Array for valid properties with the reasons
|
56
|
+
def list_invalid_properties
|
57
|
+
invalid_properties = Array.new
|
58
|
+
invalid_properties
|
59
|
+
end
|
60
|
+
|
61
|
+
# Check to see if the all the properties in the model are valid
|
62
|
+
# @return true if the model is valid
|
63
|
+
def valid?
|
64
|
+
true
|
65
|
+
end
|
66
|
+
|
67
|
+
# Checks equality by comparing each attribute.
|
68
|
+
# @param [Object] Object to be compared
|
69
|
+
def ==(o)
|
70
|
+
return true if self.equal?(o)
|
71
|
+
self.class == o.class &&
|
72
|
+
project == o.project &&
|
73
|
+
topic == o.topic
|
74
|
+
end
|
75
|
+
|
76
|
+
# @see the `==` method
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def eql?(o)
|
79
|
+
self == o
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[project, topic].hash
|
86
|
+
end
|
87
|
+
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param string type Data type
|
110
|
+
# @param string value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :BOOLEAN
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = LaunchDarklyApi.const_get(type).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Returns the string representation of the object
|
151
|
+
# @return [String] String presentation of the object
|
152
|
+
def to_s
|
153
|
+
to_hash.to_s
|
154
|
+
end
|
155
|
+
|
156
|
+
# to_body is an alias to to_hash (backward compatibility)
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_body
|
159
|
+
to_hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_hash
|
165
|
+
hash = {}
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
167
|
+
value = self.send(attr)
|
168
|
+
next if value.nil?
|
169
|
+
hash[param] = _to_hash(value)
|
170
|
+
end
|
171
|
+
hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Outputs non-array value in the form of hash
|
175
|
+
# For object, use to_hash. Otherwise, just return the value
|
176
|
+
# @param [Object] value Any valid value
|
177
|
+
# @return [Hash] Returns the value in the form of hash
|
178
|
+
def _to_hash(value)
|
179
|
+
if value.is_a?(Array)
|
180
|
+
value.compact.map { |v| _to_hash(v) }
|
181
|
+
elsif value.is_a?(Hash)
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
184
|
+
end
|
185
|
+
elsif value.respond_to? :to_hash
|
186
|
+
value.to_hash
|
187
|
+
else
|
188
|
+
value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
@@ -0,0 +1,210 @@
|
|
1
|
+
=begin
|
2
|
+
#LaunchDarkly REST API
|
3
|
+
|
4
|
+
#Build custom integrations with the LaunchDarkly REST API
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.27
|
7
|
+
Contact: support@launchdarkly.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.8
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module LaunchDarklyApi
|
16
|
+
class DestinationMParticle
|
17
|
+
attr_accessor :api_key
|
18
|
+
|
19
|
+
attr_accessor :secret
|
20
|
+
|
21
|
+
attr_accessor :user_identity
|
22
|
+
|
23
|
+
attr_accessor :environment
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'api_key' => :'apiKey',
|
29
|
+
:'secret' => :'secret',
|
30
|
+
:'user_identity' => :'userIdentity',
|
31
|
+
:'environment' => :'environment'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.swagger_types
|
37
|
+
{
|
38
|
+
:'api_key' => :'String',
|
39
|
+
:'secret' => :'String',
|
40
|
+
:'user_identity' => :'String',
|
41
|
+
:'environment' => :'String'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
52
|
+
|
53
|
+
if attributes.has_key?(:'apiKey')
|
54
|
+
self.api_key = attributes[:'apiKey']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'secret')
|
58
|
+
self.secret = attributes[:'secret']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'userIdentity')
|
62
|
+
self.user_identity = attributes[:'userIdentity']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'environment')
|
66
|
+
self.environment = attributes[:'environment']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
api_key == o.api_key &&
|
89
|
+
secret == o.secret &&
|
90
|
+
user_identity == o.user_identity &&
|
91
|
+
environment == o.environment
|
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 [Fixnum] Hash code
|
102
|
+
def hash
|
103
|
+
[api_key, secret, user_identity, environment].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 build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.swagger_types.each_pair do |key, type|
|
112
|
+
if type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Deserializes the data based on type
|
127
|
+
# @param string type Data type
|
128
|
+
# @param string value Value to be deserialized
|
129
|
+
# @return [Object] Deserialized data
|
130
|
+
def _deserialize(type, value)
|
131
|
+
case type.to_sym
|
132
|
+
when :DateTime
|
133
|
+
DateTime.parse(value)
|
134
|
+
when :Date
|
135
|
+
Date.parse(value)
|
136
|
+
when :String
|
137
|
+
value.to_s
|
138
|
+
when :Integer
|
139
|
+
value.to_i
|
140
|
+
when :Float
|
141
|
+
value.to_f
|
142
|
+
when :BOOLEAN
|
143
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
144
|
+
true
|
145
|
+
else
|
146
|
+
false
|
147
|
+
end
|
148
|
+
when :Object
|
149
|
+
# generic object (usually a Hash), return directly
|
150
|
+
value
|
151
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
152
|
+
inner_type = Regexp.last_match[:inner_type]
|
153
|
+
value.map { |v| _deserialize(inner_type, v) }
|
154
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
155
|
+
k_type = Regexp.last_match[:k_type]
|
156
|
+
v_type = Regexp.last_match[:v_type]
|
157
|
+
{}.tap do |hash|
|
158
|
+
value.each do |k, v|
|
159
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
else # model
|
163
|
+
temp_model = LaunchDarklyApi.const_get(type).new
|
164
|
+
temp_model.build_from_hash(value)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the string representation of the object
|
169
|
+
# @return [String] String presentation of the object
|
170
|
+
def to_s
|
171
|
+
to_hash.to_s
|
172
|
+
end
|
173
|
+
|
174
|
+
# to_body is an alias to to_hash (backward compatibility)
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_body
|
177
|
+
to_hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the object in the form of hash
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_hash
|
183
|
+
hash = {}
|
184
|
+
self.class.attribute_map.each_pair do |attr, param|
|
185
|
+
value = self.send(attr)
|
186
|
+
next if value.nil?
|
187
|
+
hash[param] = _to_hash(value)
|
188
|
+
end
|
189
|
+
hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Outputs non-array value in the form of hash
|
193
|
+
# For object, use to_hash. Otherwise, just return the value
|
194
|
+
# @param [Object] value Any valid value
|
195
|
+
# @return [Hash] Returns the value in the form of hash
|
196
|
+
def _to_hash(value)
|
197
|
+
if value.is_a?(Array)
|
198
|
+
value.compact.map { |v| _to_hash(v) }
|
199
|
+
elsif value.is_a?(Hash)
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
202
|
+
end
|
203
|
+
elsif value.respond_to? :to_hash
|
204
|
+
value.to_hash
|
205
|
+
else
|
206
|
+
value
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|