shipeasy-sdk 2.1.0 → 2.3.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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/docs/skill/SKILL.md +6 -2
- data/lib/generators/shipeasy/install/USAGE +24 -0
- data/lib/generators/shipeasy/install/install_generator.rb +86 -0
- data/lib/generators/shipeasy/install/templates/initializer.rb.tt +41 -0
- data/lib/shipeasy/admin.rb +85 -0
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/alert_rules_api.rb +292 -0
- data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
- data/lib/shipeasy_admin/api/configs_api.rb +680 -0
- data/lib/shipeasy_admin/api/events_api.rb +438 -0
- data/lib/shipeasy_admin/api/experiments_api.rb +727 -0
- data/lib/shipeasy_admin/api/gates_api.rb +438 -0
- data/lib/shipeasy_admin/api/i18n_api.rb +507 -0
- data/lib/shipeasy_admin/api/killswitches_api.rb +526 -0
- data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
- data/lib/shipeasy_admin/api/ops_api.rb +525 -0
- data/lib/shipeasy_admin/api/projects_api.rb +153 -0
- data/lib/shipeasy_admin/api/universes_api.rb +306 -0
- data/lib/shipeasy_admin/api_client.rb +441 -0
- data/lib/shipeasy_admin/api_error.rb +58 -0
- data/lib/shipeasy_admin/api_model_base.rb +88 -0
- data/lib/shipeasy_admin/configuration.rb +397 -0
- data/lib/shipeasy_admin/models/approve_event_request.rb +198 -0
- data/lib/shipeasy_admin/models/approve_event_response.rb +166 -0
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +408 -0
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
- data/lib/shipeasy_admin/models/create_config_request.rb +280 -0
- data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_event_request.rb +253 -0
- data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_experiment_request.rb +869 -0
- data/lib/shipeasy_admin/models/create_experiment_request_goal_metric.rb +336 -0
- data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
- data/lib/shipeasy_admin/models/create_gate_request.rb +529 -0
- data/lib/shipeasy_admin/models/create_gate_response.rb +212 -0
- data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +188 -0
- data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +263 -0
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_metric_request.rb +415 -0
- data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_ops_item_request.rb +287 -0
- data/lib/shipeasy_admin/models/create_ops_item_response.rb +177 -0
- data/lib/shipeasy_admin/models/create_universe_request.rb +289 -0
- data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
- data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_config_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_event_response.rb +189 -0
- data/lib/shipeasy_admin/models/delete_experiment_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_gate_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_killswitch_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_metric_response.rb +189 -0
- data/lib/shipeasy_admin/models/delete_universe_response.rb +188 -0
- data/lib/shipeasy_admin/models/disable_gate_response.rb +190 -0
- data/lib/shipeasy_admin/models/discard_config_draft_request.rb +190 -0
- data/lib/shipeasy_admin/models/discard_config_draft_response.rb +188 -0
- data/lib/shipeasy_admin/models/enable_gate_response.rb +190 -0
- data/lib/shipeasy_admin/models/error_response.rb +185 -0
- data/lib/shipeasy_admin/models/get_config_response.rb +351 -0
- data/lib/shipeasy_admin/models/get_current_project_response.rb +606 -0
- data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +104 -0
- data/lib/shipeasy_admin/models/get_event_response.rb +344 -0
- data/lib/shipeasy_admin/models/get_experiment_response.rb +688 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response.rb +243 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +248 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +252 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +192 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +261 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +278 -0
- data/lib/shipeasy_admin/models/get_killswitch_response.rb +270 -0
- data/lib/shipeasy_admin/models/get_metric_response.rb +378 -0
- data/lib/shipeasy_admin/models/get_ops_item_response.rb +349 -0
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +186 -0
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +166 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +478 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify.rb +177 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify_slack_channel.rb +211 -0
- data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +176 -0
- data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +280 -0
- data/lib/shipeasy_admin/models/list_configs_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +351 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +237 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +237 -0
- data/lib/shipeasy_admin/models/list_events_response_inner.rb +344 -0
- data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +289 -0
- data/lib/shipeasy_admin/models/list_experiments_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +688 -0
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +258 -0
- data/lib/shipeasy_admin/models/list_gates_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +395 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +104 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +238 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +105 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +375 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +331 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +319 -0
- data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +272 -0
- data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +195 -0
- data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +284 -0
- data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +224 -0
- data/lib/shipeasy_admin/models/list_killswitches_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +270 -0
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +248 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +378 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +295 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +113 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +217 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +233 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +240 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +266 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +264 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +228 -0
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +349 -0
- data/lib/shipeasy_admin/models/list_slack_channels_response.rb +195 -0
- data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +203 -0
- data/lib/shipeasy_admin/models/list_universes_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +305 -0
- data/lib/shipeasy_admin/models/notify_ops_request.rb +261 -0
- data/lib/shipeasy_admin/models/notify_ops_response.rb +193 -0
- data/lib/shipeasy_admin/models/publish_config_draft_request.rb +190 -0
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +260 -0
- data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +149 -0
- data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +404 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +205 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +192 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +261 -0
- data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +214 -0
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +202 -0
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +286 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +168 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +216 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +179 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +201 -0
- data/lib/shipeasy_admin/models/set_experiment_status_request.rb +190 -0
- data/lib/shipeasy_admin/models/set_experiment_status_response.rb +214 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +264 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +288 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +237 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +289 -0
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +306 -0
- data/lib/shipeasy_admin/models/update_alert_rule_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_config_request.rb +198 -0
- data/lib/shipeasy_admin/models/update_config_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_event_request.rb +198 -0
- data/lib/shipeasy_admin/models/update_event_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_experiment_request.rb +746 -0
- data/lib/shipeasy_admin/models/update_experiment_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_gate_request.rb +403 -0
- data/lib/shipeasy_admin/models/update_gate_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_i18n_key_request.rb +176 -0
- data/lib/shipeasy_admin/models/update_i18n_key_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_killswitch_request.rb +224 -0
- data/lib/shipeasy_admin/models/update_killswitch_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_ops_item_request.rb +205 -0
- data/lib/shipeasy_admin/models/update_ops_item_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_universe_request.rb +213 -0
- data/lib/shipeasy_admin/models/update_universe_response.rb +165 -0
- data/lib/shipeasy_admin/models/upsert_project_request.rb +222 -0
- data/lib/shipeasy_admin/models/upsert_project_response.rb +260 -0
- data/lib/shipeasy_admin/version.rb +15 -0
- data/lib/shipeasy_admin.rb +196 -0
- metadata +230 -2
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Shipeasy Admin API
|
|
3
|
+
|
|
4
|
+
#REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Shipeasy::Admin::Generated
|
|
17
|
+
# Body for `POST /api/admin/gates`. At minimum supply `name`; everything else has sensible defaults.
|
|
18
|
+
class CreateGateRequest < ApiModelBase
|
|
19
|
+
# Stable gate key used by SDKs (`Shipeasy.checkGate(user, '<name>')`). Single segment or `folder.name`. Lowercase letters, digits, `_` or `-`; max 128 chars. Immutable after create — rename = delete + recreate.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# Master switch. Defaults to `true`. Set `false` to create the gate disabled (evaluates to `false` regardless of rules/rollout); flip on via `POST /{id}/enable` or PATCH.
|
|
23
|
+
attr_accessor :enabled
|
|
24
|
+
|
|
25
|
+
# Initial rollout in **basis points** (0–10000 = 0%–100%) — `100` here means **1%**, not 100%. Use `rollout_percent` (0–100) below if you'd rather think in percent. Use `0` to create the gate dark and ramp via PATCH after deploy validation.
|
|
26
|
+
attr_accessor :rollout_pct
|
|
27
|
+
|
|
28
|
+
# Initial rollout as a **percentage** (0–100, fractional ok). Friendlier alias for `rollout_pct`; converted internally to basis points (e.g. `100` here = 10000 bp = 100%). If both `rollout_pct` and `rollout_percent` are set, `rollout_percent` wins.
|
|
29
|
+
attr_accessor :rollout_percent
|
|
30
|
+
|
|
31
|
+
# Targeting predicates. AND-combined. If non-empty, the gate returns `true` only for callers that satisfy every rule **and** fall under `rollout_pct`.
|
|
32
|
+
attr_accessor :rules
|
|
33
|
+
|
|
34
|
+
# Hash salt for percentage bucketing. Auto-generated if omitted. Provide explicitly to keep a gate's buckets stable across delete/recreate. **Immutable after create** — there is no PATCH for `salt` because changing it would re-bucket every caller.
|
|
35
|
+
attr_accessor :salt
|
|
36
|
+
|
|
37
|
+
# Optional gatekeeper stack. When provided, takes precedence over `rules` + `rollout_pct` at evaluation time. Omit (or pass `null`) for a flat gate.
|
|
38
|
+
attr_accessor :stack
|
|
39
|
+
|
|
40
|
+
# Human-readable title shown in the dashboard. Free-form, no key format constraint.
|
|
41
|
+
attr_accessor :title
|
|
42
|
+
|
|
43
|
+
# Long-form description / runbook. Markdown is rendered in the dashboard.
|
|
44
|
+
attr_accessor :description
|
|
45
|
+
|
|
46
|
+
# Optional folder name used to group items in the dashboard. Part of the SDK lookup key: an item in folder `checkout` named `new-cart` is referenced as `checkout/new-cart` from the SDK.
|
|
47
|
+
attr_accessor :folder
|
|
48
|
+
|
|
49
|
+
# Group label for dashboard organisation (e.g. team or product area).
|
|
50
|
+
attr_accessor :group
|
|
51
|
+
|
|
52
|
+
# Owner contact. Displayed verbatim; not used for auth.
|
|
53
|
+
attr_accessor :owner_email
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'name' => :'name',
|
|
59
|
+
:'enabled' => :'enabled',
|
|
60
|
+
:'rollout_pct' => :'rollout_pct',
|
|
61
|
+
:'rollout_percent' => :'rollout_percent',
|
|
62
|
+
:'rules' => :'rules',
|
|
63
|
+
:'salt' => :'salt',
|
|
64
|
+
:'stack' => :'stack',
|
|
65
|
+
:'title' => :'title',
|
|
66
|
+
:'description' => :'description',
|
|
67
|
+
:'folder' => :'folder',
|
|
68
|
+
:'group' => :'group',
|
|
69
|
+
:'owner_email' => :'owner_email'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns attribute mapping this model knows about
|
|
74
|
+
def self.acceptable_attribute_map
|
|
75
|
+
attribute_map
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns all the JSON keys this model knows about
|
|
79
|
+
def self.acceptable_attributes
|
|
80
|
+
acceptable_attribute_map.values
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Attribute type mapping.
|
|
84
|
+
def self.openapi_types
|
|
85
|
+
{
|
|
86
|
+
:'name' => :'String',
|
|
87
|
+
:'enabled' => :'Boolean',
|
|
88
|
+
:'rollout_pct' => :'Integer',
|
|
89
|
+
:'rollout_percent' => :'Float',
|
|
90
|
+
:'rules' => :'Array<ListGatesResponseDataInnerRulesInner>',
|
|
91
|
+
:'salt' => :'String',
|
|
92
|
+
:'stack' => :'Array<ListGatesResponseDataInnerStackInner>',
|
|
93
|
+
:'title' => :'String',
|
|
94
|
+
:'description' => :'String',
|
|
95
|
+
:'folder' => :'String',
|
|
96
|
+
:'group' => :'String',
|
|
97
|
+
:'owner_email' => :'String'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# List of attributes with nullable: true
|
|
102
|
+
def self.openapi_nullable
|
|
103
|
+
Set.new([
|
|
104
|
+
:'stack',
|
|
105
|
+
:'folder',
|
|
106
|
+
])
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Initializes the object
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
def initialize(attributes = {})
|
|
112
|
+
if (!attributes.is_a?(Hash))
|
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::CreateGateRequest` initialize method"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
117
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
118
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
119
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
120
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::CreateGateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
121
|
+
end
|
|
122
|
+
h[k.to_sym] = v
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'name')
|
|
126
|
+
self.name = attributes[:'name']
|
|
127
|
+
else
|
|
128
|
+
self.name = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'enabled')
|
|
132
|
+
self.enabled = attributes[:'enabled']
|
|
133
|
+
else
|
|
134
|
+
self.enabled = true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'rollout_pct')
|
|
138
|
+
self.rollout_pct = attributes[:'rollout_pct']
|
|
139
|
+
else
|
|
140
|
+
self.rollout_pct = 0
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'rollout_percent')
|
|
144
|
+
self.rollout_percent = attributes[:'rollout_percent']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'rules')
|
|
148
|
+
if (value = attributes[:'rules']).is_a?(Array)
|
|
149
|
+
self.rules = value
|
|
150
|
+
end
|
|
151
|
+
else
|
|
152
|
+
self.rules = nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'salt')
|
|
156
|
+
self.salt = attributes[:'salt']
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'stack')
|
|
160
|
+
if (value = attributes[:'stack']).is_a?(Array)
|
|
161
|
+
self.stack = value
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'title')
|
|
166
|
+
self.title = attributes[:'title']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'description')
|
|
170
|
+
self.description = attributes[:'description']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'folder')
|
|
174
|
+
self.folder = attributes[:'folder']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'group')
|
|
178
|
+
self.group = attributes[:'group']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'owner_email')
|
|
182
|
+
self.owner_email = attributes[:'owner_email']
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
187
|
+
# @return Array for valid properties with the reasons
|
|
188
|
+
def list_invalid_properties
|
|
189
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
190
|
+
invalid_properties = Array.new
|
|
191
|
+
if @name.nil?
|
|
192
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if @name.to_s.length > 128
|
|
196
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
|
|
200
|
+
if @name !~ pattern
|
|
201
|
+
invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if @enabled.nil?
|
|
205
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if @rollout_pct.nil?
|
|
209
|
+
invalid_properties.push('invalid value for "rollout_pct", rollout_pct cannot be nil.')
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if @rollout_pct > 10000
|
|
213
|
+
invalid_properties.push('invalid value for "rollout_pct", must be smaller than or equal to 10000.')
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if @rollout_pct < 0
|
|
217
|
+
invalid_properties.push('invalid value for "rollout_pct", must be greater than or equal to 0.')
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if !@rollout_percent.nil? && @rollout_percent > 100
|
|
221
|
+
invalid_properties.push('invalid value for "rollout_percent", must be smaller than or equal to 100.')
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if !@rollout_percent.nil? && @rollout_percent < 0
|
|
225
|
+
invalid_properties.push('invalid value for "rollout_percent", must be greater than or equal to 0.')
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if @rules.nil?
|
|
229
|
+
invalid_properties.push('invalid value for "rules", rules cannot be nil.')
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if !@salt.nil? && @salt.to_s.length > 64
|
|
233
|
+
invalid_properties.push('invalid value for "salt", the character length must be smaller than or equal to 64.')
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if !@salt.nil? && @salt.to_s.length < 1
|
|
237
|
+
invalid_properties.push('invalid value for "salt", the character length must be greater than or equal to 1.')
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if !@title.nil? && @title.to_s.length > 140
|
|
241
|
+
invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 140.')
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if !@description.nil? && @description.to_s.length > 2000
|
|
245
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if !@folder.nil? && @folder.to_s.length > 256
|
|
249
|
+
invalid_properties.push('invalid value for "folder", the character length must be smaller than or equal to 256.')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
|
|
253
|
+
if !@folder.nil? && @folder !~ pattern
|
|
254
|
+
invalid_properties.push("invalid value for \"folder\", must conform to the pattern #{pattern}.")
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if !@group.nil? && @group.to_s.length > 64
|
|
258
|
+
invalid_properties.push('invalid value for "group", the character length must be smaller than or equal to 64.')
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if !@owner_email.nil? && @owner_email.to_s.length > 190
|
|
262
|
+
invalid_properties.push('invalid value for "owner_email", the character length must be smaller than or equal to 190.')
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
invalid_properties
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Check to see if the all the properties in the model are valid
|
|
269
|
+
# @return true if the model is valid
|
|
270
|
+
def valid?
|
|
271
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
272
|
+
return false if @name.nil?
|
|
273
|
+
return false if @name.to_s.length > 128
|
|
274
|
+
return false if @name !~ Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
|
|
275
|
+
return false if @enabled.nil?
|
|
276
|
+
return false if @rollout_pct.nil?
|
|
277
|
+
return false if @rollout_pct > 10000
|
|
278
|
+
return false if @rollout_pct < 0
|
|
279
|
+
return false if !@rollout_percent.nil? && @rollout_percent > 100
|
|
280
|
+
return false if !@rollout_percent.nil? && @rollout_percent < 0
|
|
281
|
+
return false if @rules.nil?
|
|
282
|
+
return false if !@salt.nil? && @salt.to_s.length > 64
|
|
283
|
+
return false if !@salt.nil? && @salt.to_s.length < 1
|
|
284
|
+
return false if !@title.nil? && @title.to_s.length > 140
|
|
285
|
+
return false if !@description.nil? && @description.to_s.length > 2000
|
|
286
|
+
return false if !@folder.nil? && @folder.to_s.length > 256
|
|
287
|
+
return false if !@folder.nil? && @folder !~ Regexp.new(/^[a-zA-Z0-9_-]+$/)
|
|
288
|
+
return false if !@group.nil? && @group.to_s.length > 64
|
|
289
|
+
return false if !@owner_email.nil? && @owner_email.to_s.length > 190
|
|
290
|
+
true
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Custom attribute writer method with validation
|
|
294
|
+
# @param [Object] name Value to be assigned
|
|
295
|
+
def name=(name)
|
|
296
|
+
if name.nil?
|
|
297
|
+
fail ArgumentError, 'name cannot be nil'
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
if name.to_s.length > 128
|
|
301
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/)
|
|
305
|
+
if name !~ pattern
|
|
306
|
+
fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
@name = name
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Custom attribute writer method with validation
|
|
313
|
+
# @param [Object] enabled Value to be assigned
|
|
314
|
+
def enabled=(enabled)
|
|
315
|
+
if enabled.nil?
|
|
316
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
@enabled = enabled
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Custom attribute writer method with validation
|
|
323
|
+
# @param [Object] rollout_pct Value to be assigned
|
|
324
|
+
def rollout_pct=(rollout_pct)
|
|
325
|
+
if rollout_pct.nil?
|
|
326
|
+
fail ArgumentError, 'rollout_pct cannot be nil'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
if rollout_pct > 10000
|
|
330
|
+
fail ArgumentError, 'invalid value for "rollout_pct", must be smaller than or equal to 10000.'
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
if rollout_pct < 0
|
|
334
|
+
fail ArgumentError, 'invalid value for "rollout_pct", must be greater than or equal to 0.'
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
@rollout_pct = rollout_pct
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Custom attribute writer method with validation
|
|
341
|
+
# @param [Object] rollout_percent Value to be assigned
|
|
342
|
+
def rollout_percent=(rollout_percent)
|
|
343
|
+
if rollout_percent.nil?
|
|
344
|
+
fail ArgumentError, 'rollout_percent cannot be nil'
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
if rollout_percent > 100
|
|
348
|
+
fail ArgumentError, 'invalid value for "rollout_percent", must be smaller than or equal to 100.'
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
if rollout_percent < 0
|
|
352
|
+
fail ArgumentError, 'invalid value for "rollout_percent", must be greater than or equal to 0.'
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
@rollout_percent = rollout_percent
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# Custom attribute writer method with validation
|
|
359
|
+
# @param [Object] rules Value to be assigned
|
|
360
|
+
def rules=(rules)
|
|
361
|
+
if rules.nil?
|
|
362
|
+
fail ArgumentError, 'rules cannot be nil'
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
@rules = rules
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Custom attribute writer method with validation
|
|
369
|
+
# @param [Object] salt Value to be assigned
|
|
370
|
+
def salt=(salt)
|
|
371
|
+
if salt.nil?
|
|
372
|
+
fail ArgumentError, 'salt cannot be nil'
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
if salt.to_s.length > 64
|
|
376
|
+
fail ArgumentError, 'invalid value for "salt", the character length must be smaller than or equal to 64.'
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
if salt.to_s.length < 1
|
|
380
|
+
fail ArgumentError, 'invalid value for "salt", the character length must be greater than or equal to 1.'
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
@salt = salt
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
# Custom attribute writer method with validation
|
|
387
|
+
# @param [Object] title Value to be assigned
|
|
388
|
+
def title=(title)
|
|
389
|
+
if title.nil?
|
|
390
|
+
fail ArgumentError, 'title cannot be nil'
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
if title.to_s.length > 140
|
|
394
|
+
fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 140.'
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
@title = title
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
# Custom attribute writer method with validation
|
|
401
|
+
# @param [Object] description Value to be assigned
|
|
402
|
+
def description=(description)
|
|
403
|
+
if description.nil?
|
|
404
|
+
fail ArgumentError, 'description cannot be nil'
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
if description.to_s.length > 2000
|
|
408
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2000.'
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
@description = description
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# Custom attribute writer method with validation
|
|
415
|
+
# @param [Object] folder Value to be assigned
|
|
416
|
+
def folder=(folder)
|
|
417
|
+
if !folder.nil? && folder.to_s.length > 256
|
|
418
|
+
fail ArgumentError, 'invalid value for "folder", the character length must be smaller than or equal to 256.'
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
|
|
422
|
+
if !folder.nil? && folder !~ pattern
|
|
423
|
+
fail ArgumentError, "invalid value for \"folder\", must conform to the pattern #{pattern}."
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
@folder = folder
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# Custom attribute writer method with validation
|
|
430
|
+
# @param [Object] group Value to be assigned
|
|
431
|
+
def group=(group)
|
|
432
|
+
if group.nil?
|
|
433
|
+
fail ArgumentError, 'group cannot be nil'
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
if group.to_s.length > 64
|
|
437
|
+
fail ArgumentError, 'invalid value for "group", the character length must be smaller than or equal to 64.'
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
@group = group
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
# Custom attribute writer method with validation
|
|
444
|
+
# @param [Object] owner_email Value to be assigned
|
|
445
|
+
def owner_email=(owner_email)
|
|
446
|
+
if owner_email.nil?
|
|
447
|
+
fail ArgumentError, 'owner_email cannot be nil'
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
if owner_email.to_s.length > 190
|
|
451
|
+
fail ArgumentError, 'invalid value for "owner_email", the character length must be smaller than or equal to 190.'
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
@owner_email = owner_email
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# Checks equality by comparing each attribute.
|
|
458
|
+
# @param [Object] Object to be compared
|
|
459
|
+
def ==(o)
|
|
460
|
+
return true if self.equal?(o)
|
|
461
|
+
self.class == o.class &&
|
|
462
|
+
name == o.name &&
|
|
463
|
+
enabled == o.enabled &&
|
|
464
|
+
rollout_pct == o.rollout_pct &&
|
|
465
|
+
rollout_percent == o.rollout_percent &&
|
|
466
|
+
rules == o.rules &&
|
|
467
|
+
salt == o.salt &&
|
|
468
|
+
stack == o.stack &&
|
|
469
|
+
title == o.title &&
|
|
470
|
+
description == o.description &&
|
|
471
|
+
folder == o.folder &&
|
|
472
|
+
group == o.group &&
|
|
473
|
+
owner_email == o.owner_email
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# @see the `==` method
|
|
477
|
+
# @param [Object] Object to be compared
|
|
478
|
+
def eql?(o)
|
|
479
|
+
self == o
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
# Calculates hash code according to all attributes.
|
|
483
|
+
# @return [Integer] Hash code
|
|
484
|
+
def hash
|
|
485
|
+
[name, enabled, rollout_pct, rollout_percent, rules, salt, stack, title, description, folder, group, owner_email].hash
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
# Builds the object from hash
|
|
489
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
490
|
+
# @return [Object] Returns the model itself
|
|
491
|
+
def self.build_from_hash(attributes)
|
|
492
|
+
return nil unless attributes.is_a?(Hash)
|
|
493
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
494
|
+
transformed_hash = {}
|
|
495
|
+
openapi_types.each_pair do |key, type|
|
|
496
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
497
|
+
transformed_hash["#{key}"] = nil
|
|
498
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
499
|
+
# check to ensure the input is an array given that the attribute
|
|
500
|
+
# is documented as an array but the input is not
|
|
501
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
502
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
503
|
+
end
|
|
504
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
505
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
506
|
+
end
|
|
507
|
+
end
|
|
508
|
+
new(transformed_hash)
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
# Returns the object in the form of hash
|
|
512
|
+
# @return [Hash] Returns the object in the form of hash
|
|
513
|
+
def to_hash
|
|
514
|
+
hash = {}
|
|
515
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
516
|
+
value = self.send(attr)
|
|
517
|
+
if value.nil?
|
|
518
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
519
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
hash[param] = _to_hash(value)
|
|
523
|
+
end
|
|
524
|
+
hash
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
end
|