Class: ShopifyCLI::Commands::Populate::DraftOrder
- Inherits:
-
AdminAPI::PopulateResourceCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCLI::Command
- ShopifyCLI::Command::SubCommand
- AdminAPI::PopulateResourceCommand
- ShopifyCLI::Commands::Populate::DraftOrder
- Defined in:
- lib/shopify_cli/commands/populate/draft_order.rb
Constant Summary
Constants inherited from AdminAPI::PopulateResourceCommand
AdminAPI::PopulateResourceCommand::DEFAULT_COUNT
Instance Attribute Summary
Attributes inherited from AdminAPI::PopulateResourceCommand
Attributes inherited from ShopifyCLI::Command
Instance Method Summary collapse
Methods inherited from 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::Command::SubCommand
Methods inherited from ShopifyCLI::Command
call, call_help, check_node_version, check_ruby_version, check_version, #initialize, options, prerequisite_task, recommend_default_node_range, recommend_default_ruby_range, recommend_node, recommend_ruby, run_prerequisites, subcommand, subcommand_registry
Methods included from 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/shopify_cli/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/shopify_cli/commands/populate/draft_order.rb', line 20 def (data) ret = data["draftOrderCreate"]["draftOrder"] id = ShopifyCLI::API.gid_to_id(ret["id"]) @ctx.("core.populate.draft_order.added", @shop, admin_url, id) end |