ezero-apimatic-sdk 0.0.1
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/LICENSE +28 -0
- data/README.md +180 -0
- data/bin/console +15 -0
- data/lib/env_zero_api/api_helper.rb +10 -0
- data/lib/env_zero_api/apis/approval_policy_api.rb +107 -0
- data/lib/env_zero_api/apis/base_api.rb +67 -0
- data/lib/env_zero_api/apis/bulk_operations_api.rb +297 -0
- data/lib/env_zero_api/apis/configuration_api.rb +311 -0
- data/lib/env_zero_api/apis/credentials_api.rb +72 -0
- data/lib/env_zero_api/apis/deployment_logs_api.rb +79 -0
- data/lib/env_zero_api/apis/drift_api.rb +201 -0
- data/lib/env_zero_api/apis/environment_outputs_api.rb +39 -0
- data/lib/env_zero_api/apis/environments_api.rb +1082 -0
- data/lib/env_zero_api/apis/notifications_api.rb +149 -0
- data/lib/env_zero_api/apis/organization_api.rb +132 -0
- data/lib/env_zero_api/apis/projects_api.rb +202 -0
- data/lib/env_zero_api/apis/scheduling_api.rb +175 -0
- data/lib/env_zero_api/apis/templates_api.rb +206 -0
- data/lib/env_zero_api/client.rb +145 -0
- data/lib/env_zero_api/configuration.rb +166 -0
- data/lib/env_zero_api/exceptions/api_exception.rb +21 -0
- data/lib/env_zero_api/exceptions/error_exception.rb +46 -0
- data/lib/env_zero_api/http/api_response.rb +19 -0
- data/lib/env_zero_api/http/auth/basic_auth.rb +62 -0
- data/lib/env_zero_api/http/http_call_back.rb +10 -0
- data/lib/env_zero_api/http/http_method_enum.rb +10 -0
- data/lib/env_zero_api/http/http_request.rb +10 -0
- data/lib/env_zero_api/http/http_response.rb +10 -0
- data/lib/env_zero_api/http/proxy_settings.rb +22 -0
- data/lib/env_zero_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/env_zero_api/logging/sdk_logger.rb +17 -0
- data/lib/env_zero_api/models/action.rb +36 -0
- data/lib/env_zero_api/models/action_reason.rb +68 -0
- data/lib/env_zero_api/models/api_key_type.rb +26 -0
- data/lib/env_zero_api/models/api_key_user.rb +150 -0
- data/lib/env_zero_api/models/api_key_user_identity.rb +82 -0
- data/lib/env_zero_api/models/app_metadata.rb +175 -0
- data/lib/env_zero_api/models/app_metadata1.rb +60 -0
- data/lib/env_zero_api/models/approval_policy_type.rb +26 -0
- data/lib/env_zero_api/models/auto_destroy_status.rb +26 -0
- data/lib/env_zero_api/models/auto_destroy_status1.rb +26 -0
- data/lib/env_zero_api/models/auto_destroy_status2.rb +26 -0
- data/lib/env_zero_api/models/auto_destroy_status3.rb +26 -0
- data/lib/env_zero_api/models/base_model.rb +110 -0
- data/lib/env_zero_api/models/blueprint_api_add_blueprint_to_project_request_body.rb +60 -0
- data/lib/env_zero_api/models/blueprint_api_add_blueprint_to_project_response.rb +675 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_assignment.rb +98 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_assignment_request.rb +77 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_scope.rb +44 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_template.rb +375 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_template_with_scope.rb +96 -0
- data/lib/env_zero_api/models/blueprint_api_approval_policy_type.rb +26 -0
- data/lib/env_zero_api/models/blueprint_api_assign_approval_policy_request_body.rb +77 -0
- data/lib/env_zero_api/models/blueprint_api_assign_approval_policy_response.rb +98 -0
- data/lib/env_zero_api/models/blueprint_api_blueprint.rb +675 -0
- data/lib/env_zero_api/models/blueprint_api_blueprint_type.rb +26 -0
- data/lib/env_zero_api/models/blueprint_api_blueprint_type1.rb +26 -0
- data/lib/env_zero_api/models/blueprint_api_create_blueprint_request_body.rb +544 -0
- data/lib/env_zero_api/models/blueprint_api_create_blueprint_response.rb +675 -0
- data/lib/env_zero_api/models/blueprint_api_creation_scope.rb +36 -0
- data/lib/env_zero_api/models/blueprint_api_custom_flow_type.rb +26 -0
- data/lib/env_zero_api/models/blueprint_api_deployable_type.rb +26 -0
- data/lib/env_zero_api/models/blueprint_api_find_all_approval_policies_response.rb +77 -0
- data/lib/env_zero_api/models/blueprint_api_get_blueprint_by_id_response.rb +675 -0
- data/lib/env_zero_api/models/blueprint_api_retry.rb +85 -0
- data/lib/env_zero_api/models/blueprint_api_retry_deploy_or_destroy_config.rb +98 -0
- data/lib/env_zero_api/models/blueprint_api_ssh_key.rb +90 -0
- data/lib/env_zero_api/models/blueprint_api_terragrunt_tf_binary.rb +36 -0
- data/lib/env_zero_api/models/blueprint_api_update_blueprint_request_body.rb +483 -0
- data/lib/env_zero_api/models/blueprint_api_update_blueprint_response.rb +675 -0
- data/lib/env_zero_api/models/bulk_operation_type.rb +72 -0
- data/lib/env_zero_api/models/bulk_operations_api_base_payload.rb +72 -0
- data/lib/env_zero_api/models/bulk_operations_api_base_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_add_tags_request_body.rb +82 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_add_tags_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_archive_request_body.rb +72 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_archive_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_deploy_request_body.rb +80 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_deploy_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_destroy_request_body.rb +80 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_destroy_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_lock_request_body.rb +80 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_lock_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_operation_item_status.rb +26 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_operation_item_status1.rb +26 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_operation_item_status2.rb +26 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_operation_item_status3.rb +26 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_remove_tags_request_body.rb +81 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_remove_tags_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_run_task_request_body.rb +80 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_run_task_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_unlock_request_body.rb +72 -0
- data/lib/env_zero_api/models/bulk_operations_api_bulk_unlock_response.rb +91 -0
- data/lib/env_zero_api/models/bulk_operations_api_get_bulk_operation_item.rb +128 -0
- data/lib/env_zero_api/models/bulk_operations_api_get_bulk_operation_response.rb +106 -0
- data/lib/env_zero_api/models/bulk_operations_api_single_result.rb +79 -0
- data/lib/env_zero_api/models/cause_key_parts.rb +104 -0
- data/lib/env_zero_api/models/cause_key_parts1.rb +74 -0
- data/lib/env_zero_api/models/cause_key_parts2.rb +91 -0
- data/lib/env_zero_api/models/cause_key_parts4.rb +132 -0
- data/lib/env_zero_api/models/cause_key_parts5.rb +92 -0
- data/lib/env_zero_api/models/checkout_updated_code.rb +36 -0
- data/lib/env_zero_api/models/cloud_resource_api_change_event.rb +199 -0
- data/lib/env_zero_api/models/cloud_resource_api_change_event_source.rb +40 -0
- data/lib/env_zero_api/models/cloud_resource_api_management_type.rb +40 -0
- data/lib/env_zero_api/models/configuration_api_create_configuration_set_request_body.rb +108 -0
- data/lib/env_zero_api/models/configuration_api_create_configuration_set_response.rb +200 -0
- data/lib/env_zero_api/models/configuration_api_find_variable_by_id_response.rb +305 -0
- data/lib/env_zero_api/models/configuration_api_find_variables_by_scope_overriding_configuration_property.rb +342 -0
- data/lib/env_zero_api/models/configuration_property_request.rb +284 -0
- data/lib/env_zero_api/models/configuration_property_response.rb +305 -0
- data/lib/env_zero_api/models/configuration_scope.rb +60 -0
- data/lib/env_zero_api/models/configuration_set.rb +200 -0
- data/lib/env_zero_api/models/configuration_set_assignment_scope.rb +52 -0
- data/lib/env_zero_api/models/configuration_type.rb +27 -0
- data/lib/env_zero_api/models/configuration_type1.rb +27 -0
- data/lib/env_zero_api/models/credentials_api_api_key.rb +167 -0
- data/lib/env_zero_api/models/credentials_api_create_api_key_request_body.rb +91 -0
- data/lib/env_zero_api/models/credentials_api_create_api_key_response.rb +167 -0
- data/lib/env_zero_api/models/custom_env0_environment_variables.rb +537 -0
- data/lib/env_zero_api/models/custom_flow_type.rb +26 -0
- data/lib/env_zero_api/models/data.rb +65 -0
- data/lib/env_zero_api/models/data1.rb +73 -0
- data/lib/env_zero_api/models/data2.rb +73 -0
- data/lib/env_zero_api/models/data3.rb +62 -0
- data/lib/env_zero_api/models/data4.rb +61 -0
- data/lib/env_zero_api/models/data5.rb +71 -0
- data/lib/env_zero_api/models/deploy_request.rb +343 -0
- data/lib/env_zero_api/models/deployment_api_plan_attribute_change.rb +94 -0
- data/lib/env_zero_api/models/deployment_api_plan_change_action.rb +48 -0
- data/lib/env_zero_api/models/deployment_api_plan_plan.rb +118 -0
- data/lib/env_zero_api/models/deployment_api_plan_plan_output_change.rb +127 -0
- data/lib/env_zero_api/models/deployment_api_plan_plan_resource_change.rb +240 -0
- data/lib/env_zero_api/models/deployment_api_plan_plan_summary.rb +114 -0
- data/lib/env_zero_api/models/deployment_api_plan_resource_import_data.rb +74 -0
- data/lib/env_zero_api/models/deployment_command.rb +68 -0
- data/lib/env_zero_api/models/deployment_step_api_deployment_step_status.rb +64 -0
- data/lib/env_zero_api/models/deployment_step_api_find_by_deployment_log_id_response.rb +195 -0
- data/lib/env_zero_api/models/deployment_step_api_find_step_log_response.rb +117 -0
- data/lib/env_zero_api/models/deployment_step_api_log_event.rb +131 -0
- data/lib/env_zero_api/models/deployment_type.rb +40 -0
- data/lib/env_zero_api/models/deployment_type1.rb +56 -0
- data/lib/env_zero_api/models/diff.rb +75 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_environment.rb +117 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_group.rb +169 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_group1.rb +169 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_group2.rb +169 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_group4.rb +169 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_group5.rb +169 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_skip.rb +68 -0
- data/lib/env_zero_api/models/drift_api_drift_cause_skip_reason.rb +40 -0
- data/lib/env_zero_api/models/drift_api_get_drift_causes_response.rb +76 -0
- data/lib/env_zero_api/models/drift_api_get_drift_causes_response1.rb +76 -0
- data/lib/env_zero_api/models/drift_api_get_drift_fix_stats_response.rb +81 -0
- data/lib/env_zero_api/models/drift_api_get_drift_fix_stats_response1.rb +81 -0
- data/lib/env_zero_api/models/drift_api_get_ignored_drift_causes_response.rb +76 -0
- data/lib/env_zero_api/models/drift_api_ignore_drift_cause_body.rb +72 -0
- data/lib/env_zero_api/models/drift_api_ignore_drift_cause_request_body.rb +72 -0
- data/lib/env_zero_api/models/drift_api_ignore_drift_cause_response.rb +77 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_environment.rb +140 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_group.rb +157 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_group1.rb +157 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_group2.rb +157 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_group4.rb +157 -0
- data/lib/env_zero_api/models/drift_api_ignored_drift_cause_group5.rb +157 -0
- data/lib/env_zero_api/models/drift_api_state_modifying_deployment_type.rb +40 -0
- data/lib/env_zero_api/models/drift_api_un_ignore_drift_cause_request_body.rb +72 -0
- data/lib/env_zero_api/models/drift_api_un_ignore_drift_cause_response.rb +77 -0
- data/lib/env_zero_api/models/drift_api_variable_change_type.rb +40 -0
- data/lib/env_zero_api/models/drift_cause.rb +87 -0
- data/lib/env_zero_api/models/environment_api_auto_drift_remediation_strategy.rb +44 -0
- data/lib/env_zero_api/models/environment_api_cancel_response.rb +60 -0
- data/lib/env_zero_api/models/environment_api_configuration_property_change.rb +255 -0
- data/lib/env_zero_api/models/environment_api_configuration_set_changes.rb +81 -0
- data/lib/env_zero_api/models/environment_api_create_environment_request.rb +356 -0
- data/lib/env_zero_api/models/environment_api_create_request_body.rb +356 -0
- data/lib/env_zero_api/models/environment_api_create_response.rb +539 -0
- data/lib/env_zero_api/models/environment_api_deploy_request_body.rb +343 -0
- data/lib/env_zero_api/models/environment_api_deploy_request_on_create_flow.rb +154 -0
- data/lib/env_zero_api/models/environment_api_deploy_response.rb +796 -0
- data/lib/env_zero_api/models/environment_api_deployment_log.rb +792 -0
- data/lib/env_zero_api/models/environment_api_deployment_log_status.rb +76 -0
- data/lib/env_zero_api/models/environment_api_deployment_type.rb +60 -0
- data/lib/env_zero_api/models/environment_api_destroy_request_body.rb +108 -0
- data/lib/env_zero_api/models/environment_api_destroy_response.rb +60 -0
- data/lib/env_zero_api/models/environment_api_drift_cause_compass_scan_status.rb +48 -0
- data/lib/env_zero_api/models/environment_api_drift_cause_unapplied_commit.rb +111 -0
- data/lib/env_zero_api/models/environment_api_drift_cause_unmanaged_change_type.rb +36 -0
- data/lib/env_zero_api/models/environment_api_drift_detection_request.rb +81 -0
- data/lib/env_zero_api/models/environment_api_drift_status.rb +48 -0
- data/lib/env_zero_api/models/environment_api_environment.rb +539 -0
- data/lib/env_zero_api/models/environment_api_environment_lock_status.rb +119 -0
- data/lib/env_zero_api/models/environment_api_environment_next_scheduled_dates.rb +98 -0
- data/lib/env_zero_api/models/environment_api_environment_resource.rb +123 -0
- data/lib/env_zero_api/models/environment_api_environment_status.rb +84 -0
- data/lib/env_zero_api/models/environment_api_find_by_id_response.rb +539 -0
- data/lib/env_zero_api/models/environment_api_find_deployment_drift_status_response.rb +92 -0
- data/lib/env_zero_api/models/environment_api_find_deployment_log_by_id_response.rb +792 -0
- data/lib/env_zero_api/models/environment_api_get_deployment_plan_json_response.rb +86 -0
- data/lib/env_zero_api/models/environment_api_get_drifted_resource_event_details_response.rb +60 -0
- data/lib/env_zero_api/models/environment_api_get_drifted_resource_events_response.rb +98 -0
- data/lib/env_zero_api/models/environment_api_get_environments_outputs_response.rb +69 -0
- data/lib/env_zero_api/models/environment_api_get_plan_impact_destructive_change.rb +98 -0
- data/lib/env_zero_api/models/environment_api_get_plan_impact_plan_impact.rb +163 -0
- data/lib/env_zero_api/models/environment_api_get_policies_response.rb +298 -0
- data/lib/env_zero_api/models/environment_api_git_metadata.rb +110 -0
- data/lib/env_zero_api/models/environment_api_output_data.rb +103 -0
- data/lib/env_zero_api/models/environment_api_policy.rb +298 -0
- data/lib/env_zero_api/models/environment_api_remediate_drift_response.rb +792 -0
- data/lib/env_zero_api/models/environment_api_resume_response.rb +60 -0
- data/lib/env_zero_api/models/environment_api_reviewer.rb +90 -0
- data/lib/env_zero_api/models/environment_api_reviewer_user.rb +92 -0
- data/lib/env_zero_api/models/environment_api_state_file_hash.rb +87 -0
- data/lib/env_zero_api/models/environment_api_stopped_by_timeout_reason.rb +40 -0
- data/lib/env_zero_api/models/environment_api_terragrunt_run_all_output.rb +96 -0
- data/lib/env_zero_api/models/environment_api_ttl_request.rb +86 -0
- data/lib/env_zero_api/models/environment_api_ttl_request_body.rb +72 -0
- data/lib/env_zero_api/models/environment_api_ttl_response.rb +539 -0
- data/lib/env_zero_api/models/environment_api_ttl_type.rb +40 -0
- data/lib/env_zero_api/models/environment_api_update_environment_lock_request_body.rb +70 -0
- data/lib/env_zero_api/models/environment_api_update_environment_lock_response.rb +97 -0
- data/lib/env_zero_api/models/environment_api_update_policies_request_body.rb +334 -0
- data/lib/env_zero_api/models/environment_api_update_policies_response.rb +298 -0
- data/lib/env_zero_api/models/environment_api_update_request_body.rb +191 -0
- data/lib/env_zero_api/models/environment_api_update_response.rb +539 -0
- data/lib/env_zero_api/models/environment_api_update_tags_response.rb +539 -0
- data/lib/env_zero_api/models/environment_api_variable.rb +241 -0
- data/lib/env_zero_api/models/environment_api_vcs_provider.rb +56 -0
- data/lib/env_zero_api/models/environment_api_vcs_provider1.rb +56 -0
- data/lib/env_zero_api/models/environment_api_vcs_provider3.rb +56 -0
- data/lib/env_zero_api/models/environment_api_workflow_environments_workflow_file.rb +92 -0
- data/lib/env_zero_api/models/environment_api_workflow_environments_workflow_sub_environment.rb +226 -0
- data/lib/env_zero_api/models/environment_discovery_type.rb +26 -0
- data/lib/env_zero_api/models/environment_outputs_api_environment_state_access.rb +154 -0
- data/lib/env_zero_api/models/environment_outputs_api_get_state_access_config_response.rb +154 -0
- data/lib/env_zero_api/models/environment_removal_strategy.rb +36 -0
- data/lib/env_zero_api/models/environments.rb +80 -0
- data/lib/env_zero_api/models/event_name_type.rb +92 -0
- data/lib/env_zero_api/models/external_trigger_name.rb +40 -0
- data/lib/env_zero_api/models/family.rb +36 -0
- data/lib/env_zero_api/models/format.rb +40 -0
- data/lib/env_zero_api/models/git_user_data.rb +92 -0
- data/lib/env_zero_api/models/iac_type.rb +60 -0
- data/lib/env_zero_api/models/infracost_cost_estimation.rb +119 -0
- data/lib/env_zero_api/models/infracost_cost_estimation_project.rb +76 -0
- data/lib/env_zero_api/models/internal_trigger_name.rb +60 -0
- data/lib/env_zero_api/models/is_scheduled_run.rb +36 -0
- data/lib/env_zero_api/models/mode.rb +36 -0
- data/lib/env_zero_api/models/module_type.rb +26 -0
- data/lib/env_zero_api/models/notification_endpoint_type.rb +44 -0
- data/lib/env_zero_api/models/notifications_api_create_notification_endpoint_request_body.rb +122 -0
- data/lib/env_zero_api/models/notifications_api_create_notification_endpoint_response.rb +124 -0
- data/lib/env_zero_api/models/notifications_api_notification_endpoint_without_secret.rb +124 -0
- data/lib/env_zero_api/models/notifications_api_project_notification_setting.rb +102 -0
- data/lib/env_zero_api/models/notifications_api_update_project_notification_settings_request_body.rb +60 -0
- data/lib/env_zero_api/models/notifications_api_update_project_notification_settings_response.rb +102 -0
- data/lib/env_zero_api/models/organization_api_find_organization_by_id_response.rb +393 -0
- data/lib/env_zero_api/models/organization_api_get_organization_limits_response.rb +60 -0
- data/lib/env_zero_api/models/organization_api_ip_allowlist_rule.rb +119 -0
- data/lib/env_zero_api/models/organization_api_ip_allowlist_rule_type.rb +40 -0
- data/lib/env_zero_api/models/organization_api_ip_allowlist_rule_type2.rb +40 -0
- data/lib/env_zero_api/models/organization_api_organization.rb +393 -0
- data/lib/env_zero_api/models/organization_api_organization_limits.rb +60 -0
- data/lib/env_zero_api/models/organization_api_organization_mode.rb +36 -0
- data/lib/env_zero_api/models/organization_api_permissions.rb +82 -0
- data/lib/env_zero_api/models/organization_api_project_custom_flows_policy.rb +36 -0
- data/lib/env_zero_api/models/organization_api_project_permission.rb +69 -0
- data/lib/env_zero_api/models/organization_role.rb +36 -0
- data/lib/env_zero_api/models/organization_user.rb +77 -0
- data/lib/env_zero_api/models/organization_user_status.rb +36 -0
- data/lib/env_zero_api/models/output.rb +153 -0
- data/lib/env_zero_api/models/overwrites.rb +206 -0
- data/lib/env_zero_api/models/partial_json_schema7.rb +81 -0
- data/lib/env_zero_api/models/partial_json_schema72.rb +97 -0
- data/lib/env_zero_api/models/profile_data.rb +81 -0
- data/lib/env_zero_api/models/project_api_create_project_request.rb +102 -0
- data/lib/env_zero_api/models/project_api_create_project_request_body.rb +102 -0
- data/lib/env_zero_api/models/project_api_create_project_response.rb +150 -0
- data/lib/env_zero_api/models/project_api_find_by_id_response.rb +150 -0
- data/lib/env_zero_api/models/project_api_project.rb +150 -0
- data/lib/env_zero_api/models/project_api_user_access_source.rb +40 -0
- data/lib/env_zero_api/models/project_api_user_with_access.rb +148 -0
- data/lib/env_zero_api/models/requires_approval.rb +36 -0
- data/lib/env_zero_api/models/scheduling_api_disabled_reason.rb +36 -0
- data/lib/env_zero_api/models/scheduling_api_get_drift_detection_by_environment_id_response.rb +231 -0
- data/lib/env_zero_api/models/scheduling_api_get_schedule_by_environment_id_response.rb +71 -0
- data/lib/env_zero_api/models/scheduling_api_scheduled_action.rb +219 -0
- data/lib/env_zero_api/models/scheduling_api_set_drift_detection_request_body.rb +82 -0
- data/lib/env_zero_api/models/scheduling_api_set_drift_detection_response.rb +231 -0
- data/lib/env_zero_api/models/scheduling_api_set_environment_schedule_request_body.rb +75 -0
- data/lib/env_zero_api/models/scheduling_api_set_environment_schedule_request_scheduled_action.rb +70 -0
- data/lib/env_zero_api/models/scheduling_api_set_environment_schedule_response.rb +71 -0
- data/lib/env_zero_api/models/scope.rb +44 -0
- data/lib/env_zero_api/models/set_creation_scope.rb +36 -0
- data/lib/env_zero_api/models/settings.rb +76 -0
- data/lib/env_zero_api/models/skip_state_refresh.rb +36 -0
- data/lib/env_zero_api/models/status.rb +36 -0
- data/lib/env_zero_api/models/type.rb +36 -0
- data/lib/env_zero_api/models/user.rb +182 -0
- data/lib/env_zero_api/models/user1.rb +132 -0
- data/lib/env_zero_api/models/user_organization.rb +93 -0
- data/lib/env_zero_api/models/vcs.rb +368 -0
- data/lib/env_zero_api/models/workflow_deployment_options.rb +90 -0
- data/lib/env_zero_api/models/workflow_deployment_options1.rb +92 -0
- data/lib/env_zero_api/models/workflow_partial_deploy_operation.rb +40 -0
- data/lib/env_zero_api/models/workflow_sub_environment_request.rb +164 -0
- data/lib/env_zero_api/utilities/date_time_helper.rb +11 -0
- data/lib/env_zero_api/utilities/file_wrapper.rb +28 -0
- data/lib/env_zero_api/utilities/union_type_lookup.rb +379 -0
- data/lib/env_zero_api.rb +414 -0
- metadata +395 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# TemplatesApi
|
|
8
|
+
class TemplatesApi < BaseApi
|
|
9
|
+
# Assigns a template to a project, making it available for creating
|
|
10
|
+
# environments there. Returns the updated template.
|
|
11
|
+
# @param [String] id Required parameter: TODO: type description here
|
|
12
|
+
# @param [BlueprintApiAddBlueprintToProjectRequestBody] body Required
|
|
13
|
+
# parameter: TODO: type description here
|
|
14
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
15
|
+
def templates_add_blueprint_to_project(id,
|
|
16
|
+
body)
|
|
17
|
+
@api_call
|
|
18
|
+
.request(new_request_builder(HttpMethodEnum::PATCH,
|
|
19
|
+
'/blueprints/{id}/projects',
|
|
20
|
+
Server::DEFAULT)
|
|
21
|
+
.template_param(new_parameter(id, key: 'id')
|
|
22
|
+
.is_required(true)
|
|
23
|
+
.should_encode(true))
|
|
24
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
25
|
+
.body_param(new_parameter(body)
|
|
26
|
+
.is_required(true))
|
|
27
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
28
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
29
|
+
.auth(Single.new('env0_API_Key')))
|
|
30
|
+
.response(new_response_handler
|
|
31
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
32
|
+
.deserialize_into(BlueprintApiAddBlueprintToProjectResponse.method(:from_hash))
|
|
33
|
+
.is_api_response(true)
|
|
34
|
+
.local_error('401',
|
|
35
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
36
|
+
' invalid.',
|
|
37
|
+
ErrorException)
|
|
38
|
+
.local_error('403',
|
|
39
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
40
|
+
' the route does not exist for the caller.',
|
|
41
|
+
ErrorException))
|
|
42
|
+
.execute
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Please note, you can only have 1 ssh key per template
|
|
46
|
+
# @param [BlueprintApiCreateBlueprintRequestBody] body Required parameter:
|
|
47
|
+
# TODO: type description here
|
|
48
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
49
|
+
def templates_create_blueprint(body)
|
|
50
|
+
@api_call
|
|
51
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
52
|
+
'/blueprints',
|
|
53
|
+
Server::DEFAULT)
|
|
54
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
55
|
+
.body_param(new_parameter(body)
|
|
56
|
+
.is_required(true))
|
|
57
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
58
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
59
|
+
.auth(Single.new('env0_API_Key')))
|
|
60
|
+
.response(new_response_handler
|
|
61
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
62
|
+
.deserialize_into(BlueprintApiCreateBlueprintResponse.method(:from_hash))
|
|
63
|
+
.is_api_response(true)
|
|
64
|
+
.local_error('401',
|
|
65
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
66
|
+
' invalid.',
|
|
67
|
+
ErrorException)
|
|
68
|
+
.local_error('403',
|
|
69
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
70
|
+
' the route does not exist for the caller.',
|
|
71
|
+
ErrorException))
|
|
72
|
+
.execute
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns all Templates associated with either an Organization or Project.
|
|
76
|
+
# At least one of these must be set.
|
|
77
|
+
# @param [String] organization_id Optional parameter: An Organization ID to
|
|
78
|
+
# filter by
|
|
79
|
+
# @param [String] project_id Optional parameter: A Project ID to filter by
|
|
80
|
+
# @param [String] name Optional parameter: Exact Template name to filter by
|
|
81
|
+
# (only with organizationId)
|
|
82
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
83
|
+
def templates_find_all(organization_id: nil,
|
|
84
|
+
project_id: nil,
|
|
85
|
+
name: nil)
|
|
86
|
+
@api_call
|
|
87
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
88
|
+
'/blueprints',
|
|
89
|
+
Server::DEFAULT)
|
|
90
|
+
.query_param(new_parameter(organization_id, key: 'organizationId'))
|
|
91
|
+
.query_param(new_parameter(project_id, key: 'projectId'))
|
|
92
|
+
.query_param(new_parameter(name, key: 'name'))
|
|
93
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
94
|
+
.auth(Single.new('env0_API_Key')))
|
|
95
|
+
.response(new_response_handler
|
|
96
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
97
|
+
.deserialize_into(BlueprintApiBlueprint.method(:from_hash))
|
|
98
|
+
.is_api_response(true)
|
|
99
|
+
.is_response_array(true)
|
|
100
|
+
.local_error('401',
|
|
101
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
102
|
+
' invalid.',
|
|
103
|
+
ErrorException)
|
|
104
|
+
.local_error('403',
|
|
105
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
106
|
+
' the route does not exist for the caller.',
|
|
107
|
+
ErrorException))
|
|
108
|
+
.execute
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns a list of templates that can be assigned to the specified project,
|
|
112
|
+
# including those from parent projects and the organization.
|
|
113
|
+
# @param [String] project_id Required parameter: TODO: type description
|
|
114
|
+
# here
|
|
115
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
116
|
+
def templates_get_assignable_templates(project_id)
|
|
117
|
+
@api_call
|
|
118
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
119
|
+
'/blueprints/assignable/{projectId}',
|
|
120
|
+
Server::DEFAULT)
|
|
121
|
+
.template_param(new_parameter(project_id, key: 'projectId')
|
|
122
|
+
.is_required(true)
|
|
123
|
+
.should_encode(true))
|
|
124
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
125
|
+
.auth(Single.new('env0_API_Key')))
|
|
126
|
+
.response(new_response_handler
|
|
127
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
128
|
+
.deserialize_into(BlueprintApiBlueprint.method(:from_hash))
|
|
129
|
+
.is_api_response(true)
|
|
130
|
+
.is_response_array(true)
|
|
131
|
+
.local_error('401',
|
|
132
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
133
|
+
' invalid.',
|
|
134
|
+
ErrorException)
|
|
135
|
+
.local_error('403',
|
|
136
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
137
|
+
' the route does not exist for the caller.',
|
|
138
|
+
ErrorException))
|
|
139
|
+
.execute
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Returns a template by id, including its repository, revision, path, IaC
|
|
143
|
+
# type and version, retry configuration, and the projects it is assigned to.
|
|
144
|
+
# @param [String] id Required parameter: TODO: type description here
|
|
145
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
146
|
+
def templates_get_blueprint_by_id(id)
|
|
147
|
+
@api_call
|
|
148
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
149
|
+
'/blueprints/{id}',
|
|
150
|
+
Server::DEFAULT)
|
|
151
|
+
.template_param(new_parameter(id, key: 'id')
|
|
152
|
+
.is_required(true)
|
|
153
|
+
.should_encode(true))
|
|
154
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
155
|
+
.auth(Single.new('env0_API_Key')))
|
|
156
|
+
.response(new_response_handler
|
|
157
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
158
|
+
.deserialize_into(BlueprintApiGetBlueprintByIdResponse.method(:from_hash))
|
|
159
|
+
.is_api_response(true)
|
|
160
|
+
.local_error('401',
|
|
161
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
162
|
+
' invalid.',
|
|
163
|
+
ErrorException)
|
|
164
|
+
.local_error('403',
|
|
165
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
166
|
+
' the route does not exist for the caller.',
|
|
167
|
+
ErrorException))
|
|
168
|
+
.execute
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Please note, you can only have 1 ssh key per template
|
|
172
|
+
# @param [String] id Required parameter: TODO: type description here
|
|
173
|
+
# @param [BlueprintApiUpdateBlueprintRequestBody] body Required parameter:
|
|
174
|
+
# TODO: type description here
|
|
175
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
176
|
+
def templates_update_blueprint(id,
|
|
177
|
+
body)
|
|
178
|
+
@api_call
|
|
179
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
180
|
+
'/blueprints/{id}',
|
|
181
|
+
Server::DEFAULT)
|
|
182
|
+
.template_param(new_parameter(id, key: 'id')
|
|
183
|
+
.is_required(true)
|
|
184
|
+
.should_encode(true))
|
|
185
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
186
|
+
.body_param(new_parameter(body)
|
|
187
|
+
.is_required(true))
|
|
188
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
189
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
190
|
+
.auth(Single.new('env0_API_Key')))
|
|
191
|
+
.response(new_response_handler
|
|
192
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
193
|
+
.deserialize_into(BlueprintApiUpdateBlueprintResponse.method(:from_hash))
|
|
194
|
+
.is_api_response(true)
|
|
195
|
+
.local_error('401',
|
|
196
|
+
'Authentication failed - the API key ID or secret is missing or'\
|
|
197
|
+
' invalid.',
|
|
198
|
+
ErrorException)
|
|
199
|
+
.local_error('403',
|
|
200
|
+
'The authenticated key lacks permission for this resource, or'\
|
|
201
|
+
' the route does not exist for the caller.',
|
|
202
|
+
ErrorException))
|
|
203
|
+
.execute
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# env_zero_api client class.
|
|
8
|
+
class Client
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_reader :config, :auth_managers
|
|
11
|
+
|
|
12
|
+
def user_agent_detail
|
|
13
|
+
config.user_agent_detail
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Access to environments controller.
|
|
17
|
+
# @return [EnvironmentsApi] Returns the controller instance.
|
|
18
|
+
def environments
|
|
19
|
+
@environments ||= EnvironmentsApi.new @global_configuration
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Access to drift controller.
|
|
23
|
+
# @return [DriftApi] Returns the controller instance.
|
|
24
|
+
def drift
|
|
25
|
+
@drift ||= DriftApi.new @global_configuration
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Access to scheduling controller.
|
|
29
|
+
# @return [SchedulingApi] Returns the controller instance.
|
|
30
|
+
def scheduling
|
|
31
|
+
@scheduling ||= SchedulingApi.new @global_configuration
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Access to bulk_operations controller.
|
|
35
|
+
# @return [BulkOperationsApi] Returns the controller instance.
|
|
36
|
+
def bulk_operations
|
|
37
|
+
@bulk_operations ||= BulkOperationsApi.new @global_configuration
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Access to deployment_logs controller.
|
|
41
|
+
# @return [DeploymentLogsApi] Returns the controller instance.
|
|
42
|
+
def deployment_logs
|
|
43
|
+
@deployment_logs ||= DeploymentLogsApi.new @global_configuration
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Access to templates controller.
|
|
47
|
+
# @return [TemplatesApi] Returns the controller instance.
|
|
48
|
+
def templates
|
|
49
|
+
@templates ||= TemplatesApi.new @global_configuration
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Access to configuration controller.
|
|
53
|
+
# @return [ConfigurationApi] Returns the controller instance.
|
|
54
|
+
def configuration
|
|
55
|
+
@configuration ||= ConfigurationApi.new @global_configuration
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Access to projects controller.
|
|
59
|
+
# @return [ProjectsApi] Returns the controller instance.
|
|
60
|
+
def projects
|
|
61
|
+
@projects ||= ProjectsApi.new @global_configuration
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Access to organization controller.
|
|
65
|
+
# @return [OrganizationApi] Returns the controller instance.
|
|
66
|
+
def organization
|
|
67
|
+
@organization ||= OrganizationApi.new @global_configuration
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Access to notifications controller.
|
|
71
|
+
# @return [NotificationsApi] Returns the controller instance.
|
|
72
|
+
def notifications
|
|
73
|
+
@notifications ||= NotificationsApi.new @global_configuration
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Access to approval_policy controller.
|
|
77
|
+
# @return [ApprovalPolicyApi] Returns the controller instance.
|
|
78
|
+
def approval_policy
|
|
79
|
+
@approval_policy ||= ApprovalPolicyApi.new @global_configuration
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Access to credentials controller.
|
|
83
|
+
# @return [CredentialsApi] Returns the controller instance.
|
|
84
|
+
def credentials
|
|
85
|
+
@credentials ||= CredentialsApi.new @global_configuration
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Access to environment_outputs controller.
|
|
89
|
+
# @return [EnvironmentOutputsApi] Returns the controller instance.
|
|
90
|
+
def environment_outputs
|
|
91
|
+
@environment_outputs ||= EnvironmentOutputsApi.new @global_configuration
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def initialize(
|
|
95
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
96
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
97
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
98
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
99
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
100
|
+
basic_auth_credentials: nil, config: nil
|
|
101
|
+
)
|
|
102
|
+
@config = if config.nil?
|
|
103
|
+
Configuration.new(
|
|
104
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
|
105
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
106
|
+
backoff_factor: backoff_factor,
|
|
107
|
+
retry_statuses: retry_statuses,
|
|
108
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
109
|
+
proxy_settings: proxy_settings,
|
|
110
|
+
logging_configuration: logging_configuration,
|
|
111
|
+
environment: environment,
|
|
112
|
+
basic_auth_credentials: basic_auth_credentials
|
|
113
|
+
)
|
|
114
|
+
else
|
|
115
|
+
config
|
|
116
|
+
end
|
|
117
|
+
user_agent_params = BaseApi.user_agent_parameters
|
|
118
|
+
|
|
119
|
+
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
|
120
|
+
.base_uri_executor(@config.method(:get_base_uri))
|
|
121
|
+
.global_errors(BaseApi::GLOBAL_ERRORS)
|
|
122
|
+
.user_agent(BaseApi.user_agent,
|
|
123
|
+
agent_parameters: user_agent_params)
|
|
124
|
+
|
|
125
|
+
initialize_auth_managers(@global_configuration)
|
|
126
|
+
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Initializes the auth managers hash used for authenticating API calls.
|
|
130
|
+
# @param [GlobalConfiguration] global_config The global configuration of the SDK)
|
|
131
|
+
def initialize_auth_managers(global_config)
|
|
132
|
+
@auth_managers = {}
|
|
133
|
+
http_client_config = global_config.client_configuration
|
|
134
|
+
%w[env0_API_Key].each { |auth| @auth_managers[auth] = nil }
|
|
135
|
+
@auth_managers['env0_API_Key'] = BasicAuth.new(http_client_config.basic_auth_credentials)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Creates a client directly from environment variables.
|
|
139
|
+
def self.from_env(**overrides)
|
|
140
|
+
default_config = Configuration.build_default_config_from_env
|
|
141
|
+
new_config = default_config.clone_with(**overrides)
|
|
142
|
+
new(config: new_config)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# An enum for SDK environments.
|
|
8
|
+
class Environment
|
|
9
|
+
# PRODUCTION: env zero production API
|
|
10
|
+
ENVIRONMENT = [
|
|
11
|
+
PRODUCTION = 'production'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
# Converts a string or symbol into a valid Environment constant.
|
|
15
|
+
def self.from_value(value, default_value = PRODUCTION)
|
|
16
|
+
return default_value if value.nil?
|
|
17
|
+
|
|
18
|
+
default_value
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# An enum for API servers.
|
|
23
|
+
class Server
|
|
24
|
+
SERVER = [
|
|
25
|
+
DEFAULT = 'default'.freeze
|
|
26
|
+
].freeze
|
|
27
|
+
|
|
28
|
+
# Converts a string or symbol into a valid Server constant.
|
|
29
|
+
def self.from_value(value, default_value = DEFAULT)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# All configuration including auth info and base URI for the API access
|
|
37
|
+
# are configured in this class.
|
|
38
|
+
class Configuration < CoreLibrary::HttpClientConfiguration
|
|
39
|
+
# The attribute readers for properties.
|
|
40
|
+
attr_reader :environment, :basic_auth_credentials
|
|
41
|
+
|
|
42
|
+
class << self
|
|
43
|
+
attr_reader :environments
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(
|
|
47
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
48
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
49
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
50
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
51
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
52
|
+
basic_auth_credentials: nil
|
|
53
|
+
)
|
|
54
|
+
super connection: connection, adapter: adapter, timeout: timeout,
|
|
55
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
56
|
+
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
|
57
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
58
|
+
proxy_settings: proxy_settings,
|
|
59
|
+
logging_configuration: logging_configuration
|
|
60
|
+
|
|
61
|
+
# Current API environment
|
|
62
|
+
@environment = String(environment)
|
|
63
|
+
|
|
64
|
+
# The object holding Basic Authentication credentials
|
|
65
|
+
@basic_auth_credentials = basic_auth_credentials
|
|
66
|
+
|
|
67
|
+
# Initializing Basic Authentication credentials with the provided auth parameters
|
|
68
|
+
@basic_auth_credentials = basic_auth_credentials
|
|
69
|
+
|
|
70
|
+
# The Http Client to use for making requests.
|
|
71
|
+
set_http_client CoreLibrary::FaradayClient.new(self)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def clone_with(connection: nil, adapter: nil, timeout: nil,
|
|
75
|
+
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
|
76
|
+
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
|
77
|
+
proxy_settings: nil, logging_configuration: nil,
|
|
78
|
+
environment: nil, basic_auth_credentials: nil)
|
|
79
|
+
connection ||= self.connection
|
|
80
|
+
adapter ||= self.adapter
|
|
81
|
+
timeout ||= self.timeout
|
|
82
|
+
max_retries ||= self.max_retries
|
|
83
|
+
retry_interval ||= self.retry_interval
|
|
84
|
+
backoff_factor ||= self.backoff_factor
|
|
85
|
+
retry_statuses ||= self.retry_statuses
|
|
86
|
+
retry_methods ||= self.retry_methods
|
|
87
|
+
http_callback ||= self.http_callback
|
|
88
|
+
proxy_settings ||= self.proxy_settings
|
|
89
|
+
logging_configuration ||= self.logging_configuration
|
|
90
|
+
environment ||= self.environment
|
|
91
|
+
basic_auth_credentials ||= self.basic_auth_credentials
|
|
92
|
+
|
|
93
|
+
Configuration.new(connection: connection, adapter: adapter,
|
|
94
|
+
timeout: timeout, max_retries: max_retries,
|
|
95
|
+
retry_interval: retry_interval,
|
|
96
|
+
backoff_factor: backoff_factor,
|
|
97
|
+
retry_statuses: retry_statuses,
|
|
98
|
+
retry_methods: retry_methods,
|
|
99
|
+
http_callback: http_callback,
|
|
100
|
+
proxy_settings: proxy_settings,
|
|
101
|
+
logging_configuration: logging_configuration,
|
|
102
|
+
environment: environment,
|
|
103
|
+
basic_auth_credentials: basic_auth_credentials)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# All the environments the SDK can run in.
|
|
108
|
+
ENVIRONMENTS = {
|
|
109
|
+
Environment::PRODUCTION => {
|
|
110
|
+
Server::DEFAULT => 'https://api.env0.com'
|
|
111
|
+
}
|
|
112
|
+
}.freeze
|
|
113
|
+
|
|
114
|
+
# Generates the appropriate base URI for the environment and the server.
|
|
115
|
+
# @param [Configuration::Server] server The server enum for which the base URI is
|
|
116
|
+
# required.
|
|
117
|
+
# @return [String] The base URI.
|
|
118
|
+
def get_base_uri(server = Server::DEFAULT)
|
|
119
|
+
ENVIRONMENTS[environment][server].clone
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Builds a Configuration instance using environment variables.
|
|
123
|
+
def self.build_default_config_from_env
|
|
124
|
+
# === Core environment ===
|
|
125
|
+
environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
|
|
126
|
+
timeout = (ENV['TIMEOUT'] || 30).to_f
|
|
127
|
+
max_retries = (ENV['MAX_RETRIES'] || 0).to_i
|
|
128
|
+
retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
|
|
129
|
+
backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
|
|
130
|
+
retry_statuses = ENV.fetch('RETRY_STATUSES',
|
|
131
|
+
'[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
|
|
132
|
+
.split(',')
|
|
133
|
+
.map(&:strip)
|
|
134
|
+
.map do |item|
|
|
135
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
136
|
+
end
|
|
137
|
+
retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
|
|
138
|
+
.split(',')
|
|
139
|
+
.map(&:strip)
|
|
140
|
+
.map do |item|
|
|
141
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# === Authentication credentials ===
|
|
145
|
+
basic_auth_credentials = BasicAuthCredentials.from_env
|
|
146
|
+
|
|
147
|
+
# === Proxy settings ===
|
|
148
|
+
proxy_settings = ProxySettings.from_env
|
|
149
|
+
# === Logging Configuration ===
|
|
150
|
+
logging_configuration = LoggingConfiguration.from_env if LoggingConfiguration.any_logging_configured?
|
|
151
|
+
|
|
152
|
+
Configuration.new(
|
|
153
|
+
environment: environment,
|
|
154
|
+
timeout: timeout,
|
|
155
|
+
max_retries: max_retries,
|
|
156
|
+
retry_interval: retry_interval,
|
|
157
|
+
backoff_factor: backoff_factor,
|
|
158
|
+
retry_statuses: retry_statuses,
|
|
159
|
+
retry_methods: retry_methods,
|
|
160
|
+
basic_auth_credentials: basic_auth_credentials,
|
|
161
|
+
proxy_settings: proxy_settings,
|
|
162
|
+
logging_configuration: logging_configuration
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# Class for exceptions when there is a network error, status code error, etc.
|
|
8
|
+
class APIException < CoreLibrary::ApiException
|
|
9
|
+
# Provides a human-readable string representation of the object.
|
|
10
|
+
def to_s
|
|
11
|
+
class_name = self.class.name.split('::').last
|
|
12
|
+
"<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
16
|
+
def inspect
|
|
17
|
+
class_name = self.class.name.split('::').last
|
|
18
|
+
"<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# Standard env zero error envelope.
|
|
8
|
+
class ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Human-readable error message.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :message
|
|
15
|
+
|
|
16
|
+
# The constructor.
|
|
17
|
+
# @param [String] reason The reason for raising an exception.
|
|
18
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
19
|
+
def initialize(reason, response)
|
|
20
|
+
super(reason, response)
|
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
22
|
+
unbox(hash)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Populates this object by extracting properties from a hash.
|
|
26
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
27
|
+
# response body.
|
|
28
|
+
def unbox(hash)
|
|
29
|
+
return nil unless hash
|
|
30
|
+
|
|
31
|
+
@message = hash.key?('message') ? hash['message'] : nil
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Provides a human-readable string representation of the object.
|
|
35
|
+
def to_s
|
|
36
|
+
class_name = self.class.name.split('::').last
|
|
37
|
+
"<#{class_name} message: #{@message}>"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
41
|
+
def inspect
|
|
42
|
+
class_name = self.class.name.split('::').last
|
|
43
|
+
"<#{class_name} message: #{@message.inspect}>"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# Http response received.
|
|
8
|
+
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
|
+
# The constructor
|
|
10
|
+
# @param [HttpResponse] http_response The original, raw response from the api.
|
|
11
|
+
# @param [Object] data The data field specified for the response.
|
|
12
|
+
# @param [Array<String>] errors Any errors returned by the server.
|
|
13
|
+
def initialize(http_response,
|
|
14
|
+
data: nil,
|
|
15
|
+
errors: nil)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# Utility class for basic authorization.
|
|
8
|
+
class BasicAuth < CoreLibrary::HeaderAuth
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
# Display error message on occurrence of authentication failure.
|
|
11
|
+
# @returns [String] The oAuth error message.
|
|
12
|
+
def error_message
|
|
13
|
+
'BasicAuth: basic_auth_user_name or basic_auth_password is undefined.'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Initialization constructor.
|
|
17
|
+
def initialize(basic_auth_credentials)
|
|
18
|
+
auth_params = {}
|
|
19
|
+
unless basic_auth_credentials.nil? ||
|
|
20
|
+
basic_auth_credentials.username.nil? ||
|
|
21
|
+
basic_auth_credentials.password.nil?
|
|
22
|
+
auth_params['Authorization'] =
|
|
23
|
+
"Basic #{AuthHelper.get_base64_encoded_value(basic_auth_credentials.username,
|
|
24
|
+
basic_auth_credentials.password)}"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
super auth_params
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Data class for BasicAuthCredentials.
|
|
32
|
+
class BasicAuthCredentials
|
|
33
|
+
attr_reader :username, :password
|
|
34
|
+
|
|
35
|
+
def initialize(username:, password:)
|
|
36
|
+
raise ArgumentError, 'username cannot be nil' if username.nil?
|
|
37
|
+
raise ArgumentError, 'password cannot be nil' if password.nil?
|
|
38
|
+
|
|
39
|
+
@username = username
|
|
40
|
+
@password = password
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.from_env
|
|
44
|
+
username = ENV['USERNAME']
|
|
45
|
+
password = ENV['PASSWORD']
|
|
46
|
+
all_nil = [
|
|
47
|
+
username,
|
|
48
|
+
password
|
|
49
|
+
].all?(&:nil?)
|
|
50
|
+
return nil if all_nil
|
|
51
|
+
|
|
52
|
+
new(username: username, password: password)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def clone_with(username: nil, password: nil)
|
|
56
|
+
username ||= self.username
|
|
57
|
+
password ||= self.password
|
|
58
|
+
|
|
59
|
+
BasicAuthCredentials.new(username: username, password: password)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# env_zero_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EnvZeroApi
|
|
7
|
+
# HttpCallBack allows defining callables for pre and post API calls.
|
|
8
|
+
class HttpCallBack < CoreLibrary::HttpCallback
|
|
9
|
+
end
|
|
10
|
+
end
|