Class: ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::CreateMethodsStep
- Inherits:
-
Object
- Object
- ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::CreateMethodsStep
- Includes:
- Step
- Defined in:
- lib/3scale_toolbox/commands/import_command/openapi/create_method_step.rb
Instance Attribute Summary
Attributes included from Step
Instance Method Summary collapse
Methods included from Step
#api_spec, #backend_api_host_header, #backend_api_secret_token, #base_path, #build_3scale_operations, #default_credentials_userkey, #initialize, #oidc_issuer_endpoint, #operations, #override_private_base_url, #override_private_basepath, #override_public_basepath, #prefix_matching, #private_base_path, #production_public_base_url, #public_base_path, #resource, #service, #service=, #staging_public_base_url, #target_system_name, #threescale_client
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/create_method_step.rb', line 8 def call missing_operations.each do |op| method = Entities::Method.create(service: service, parent_id: hits_metric_id, attrs: op.method) op.set(:metric_id, method.id) end existing_operations.each do |op| method_attrs = methods_index.fetch(op.method['system_name']) method = Entities::Method.new( id: method_attrs.fetch('id'), parent_id: hits_metric_id, service: service ) method.update(op.method) op.set(:metric_id, method.id) end end |