Module: ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::Step
- Included in:
- CreateActiveDocsStep, CreateMappingRulesStep, CreateMethodsStep, CreateServiceStep, UpdatePoliciesStep, UpdateServiceOidcConfStep, UpdateServiceProxyStep
- Defined in:
- lib/3scale_toolbox/commands/import_command/openapi/step.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #api_spec ⇒ Object
- #backend_api_host_header ⇒ Object
- #backend_api_secret_token ⇒ Object
- #base_path ⇒ Object
- #build_3scale_operations ⇒ Object
- #default_credentials_userkey ⇒ Object
- #initialize(context) ⇒ Object
- #oidc_issuer_endpoint ⇒ Object
- #operations ⇒ Object
- #override_private_base_url ⇒ Object
- #override_private_basepath ⇒ Object
- #override_public_basepath ⇒ Object
- #prefix_matching ⇒ Object
- #private_base_path ⇒ Object
- #production_public_base_url ⇒ Object
- #public_base_path ⇒ Object
- #resource ⇒ Object
-
#service ⇒ Object
Can be nil on initialization time and not nil afterwards method to fetch from context required.
- #service=(service) ⇒ Object
- #staging_public_base_url ⇒ Object
- #target_system_name ⇒ Object
- #threescale_client ⇒ Object
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 6 def context @context end |
Instance Method Details
#api_spec ⇒ Object
22 23 24 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 22 def api_spec context[:api_spec] end |
#backend_api_host_header ⇒ Object
92 93 94 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 92 def backend_api_host_header context[:backend_api_host_header] end |
#backend_api_secret_token ⇒ Object
88 89 90 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 88 def backend_api_secret_token context[:backend_api_secret_token] end |
#base_path ⇒ Object
100 101 102 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 100 def base_path api_spec.base_path || '/' end |
#build_3scale_operations ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 37 def build_3scale_operations api_spec.operations.map do |op| Operation.new( base_path: base_path, public_base_path: public_base_path, path: op[:path], verb: op[:verb], operationId: op[:operation_id], description: op[:description], prefix_matching: prefix_matching, ) end end |
#default_credentials_userkey ⇒ Object
64 65 66 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 64 def default_credentials_userkey context[:default_credentials_userkey] end |
#initialize(context) ⇒ Object
8 9 10 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 8 def initialize(context) @context = context end |
#oidc_issuer_endpoint ⇒ Object
60 61 62 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 60 def oidc_issuer_endpoint context[:oidc_issuer_endpoint] end |
#operations ⇒ Object
30 31 32 33 34 35 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 30 def operations # api_spec.operations are readonly # store operations in context # each operation can be extended with extra information to be used later context[:operations] ||= build_3scale_operations end |
#override_private_base_url ⇒ Object
84 85 86 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 84 def override_private_base_url context[:override_private_base_url] end |
#override_private_basepath ⇒ Object
68 69 70 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 68 def override_private_basepath context[:override_private_basepath] end |
#override_public_basepath ⇒ Object
72 73 74 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 72 def override_public_basepath context[:override_public_basepath] end |
#prefix_matching ⇒ Object
96 97 98 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 96 def prefix_matching context[:prefix_matching] end |
#private_base_path ⇒ Object
108 109 110 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 108 def private_base_path override_private_basepath || base_path end |
#production_public_base_url ⇒ Object
76 77 78 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 76 def production_public_base_url context[:production_public_base_url] end |
#public_base_path ⇒ Object
104 105 106 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 104 def public_base_path override_public_basepath || base_path end |
#resource ⇒ Object
56 57 58 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 56 def resource context[:api_spec_resource] end |
#service ⇒ Object
Can be nil on initialization time and not nil afterwards method to fetch from context required
14 15 16 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 14 def service context[:target] end |
#service=(service) ⇒ Object
18 19 20 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 18 def service=(service) context[:target] = service end |
#staging_public_base_url ⇒ Object
80 81 82 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 80 def staging_public_base_url context[:staging_public_base_url] end |
#target_system_name ⇒ Object
51 52 53 54 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 51 def target_system_name # could be nil context[:target_system_name] end |
#threescale_client ⇒ Object
26 27 28 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 26 def threescale_client context[:threescale_client] end |