modulePactBrokermoduleClientmoduleCLImoduleEnvironmentCommandsENVIRONMENT_PARAM_NAMES=[:name,:display_name,:production,:contact_name,:contact_email_address]defself.included(thor)thor.class_evaldodefself.shared_environment_options(name_required: false)method_option:name,required: name_required,desc: "The uniquely identifying name of the environment as used in deployment code"method_option:display_name,desc: "The display name of the environment"method_option:production,type: :boolean,default: false,desc: "Whether or not this environment is a production environment. This is currently informational only."method_option:contact_name,required: false,desc: "The name of the team/person responsible for this environment"method_option:contact_email_address,required: false,desc: "The email address of the team/person responsible for this environment"output_option_json_or_textenddesc"create-environment","Create an environment resource in the Pact Broker to represent a real world deployment or release environment."shared_environment_options(name_required: true)shared_authentication_optionsdefcreate_environmentexecute_environment_command(params_from_options(ENVIRONMENT_PARAM_NAMES),"CreateEnvironment")enddesc"update-environment","Update an environment resource in the Pact Broker."method_option:uuid,required: true,desc: "The UUID of the environment to update"shared_environment_options(name_required: false)shared_authentication_optionsdefupdate_environmentexecute_environment_command(params_from_options(ENVIRONMENT_PARAM_NAMES+[:uuid]),"UpdateEnvironment")enddesc"describe-environment","Describe an environment"method_option:uuid,required: true,desc: "The UUID of the environment to describe"method_option:output,aliases: "-o",desc: "json or text",default: 'text'shared_authentication_optionsdefdescribe_environmentexecute_environment_command(params_from_options([:uuid]),"DescribeEnvironment")enddesc"list-environments","List environments"method_option:output,aliases: "-o",desc: "json or text",default: 'text'shared_authentication_optionsdeflist_environmentsexecute_environment_command({},"ListEnvironments")enddesc"delete-environment","Delete an environment"method_option:uuid,required: true,desc: "The UUID of the environment to delete"method_option:output,aliases: "-o",desc: "json or text",default: 'text'shared_authentication_optionsdefdelete_environmentexecute_environment_command(params_from_options([:uuid]),"DeleteEnvironment")endno_commandsdodefexecute_environment_command(params,command_class_name)require'pact_broker/client/environments'command_options={verbose: options.verbose,output: options.output}result=PactBroker::Client::Environments.const_get(command_class_name).call(params,command_options,pact_broker_client_options)$stdout.putsresult.messageexit(1)unlessresult.successendendendendendendendend