Class: Node::Commands::Populate::DraftOrder
- Inherits:
-
ShopifyCli::AdminAPI::PopulateResourceCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCli::Command
- ShopifyCli::SubCommand
- ShopifyCli::AdminAPI::PopulateResourceCommand
- Node::Commands::Populate::DraftOrder
- Defined in:
- lib/project_types/node/commands/populate/draft_order.rb
Constant Summary
Constants inherited from ShopifyCli::AdminAPI::PopulateResourceCommand
ShopifyCli::AdminAPI::PopulateResourceCommand::DEFAULT_COUNT
Instance Attribute Summary
Attributes inherited from ShopifyCli::AdminAPI::PopulateResourceCommand
Attributes inherited from ShopifyCli::Command
Instance Method Summary collapse
Methods inherited from ShopifyCli::AdminAPI::PopulateResourceCommand
#admin_url, #call, call, #completion_message, #display_parent_extended_help, #display_parent_help, help, #input_options, #populate, #price, #resource_options, #run_mutation, #schema
Methods inherited from ShopifyCli::SubCommand
Methods inherited from ShopifyCli::Command
call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry
Methods included from ShopifyCli::Feature::Set
Constructor Details
This class inherits a constructor from ShopifyCli::Command
Instance Method Details
#defaults ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/project_types/node/commands/populate/draft_order.rb', line 9 def defaults { lineItems: [{ originalUnitPrice: price, quantity: 1, weight: { value: 10, unit: 'GRAMS' }, title: ShopifyCli::Helpers::Haikunator.title, }], } end |
#message(data) ⇒ Object
20 21 22 23 24 |
# File 'lib/project_types/node/commands/populate/draft_order.rb', line 20 def (data) ret = data['draftOrderCreate']['draftOrder'] id = ShopifyCli::API.gid_to_id(ret['id']) @ctx.('node.populate.draft_order.added', ShopifyCli::Project.current.env.shop, admin_url, id) end |