Class: PactBroker::Client::Versions::Create

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/pact_broker/client/versions/create.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

call, #call, #initialize

Methods included from HalClientMethods

#create_entry_point, #create_http_client, #create_index_entry_point, #index_entry_point, #index_resource, #is_pactflow?, #pact_broker_name

Constructor Details

This class inherits a constructor from PactBroker::Client::BaseCommand

Instance Method Details

#do_callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/pact_broker/client/versions/create.rb', line 9

def do_call
  if branch_name
    if branch_versions_supported?
      create_branch_version
    else
      raise PactBroker::Client::Error.new("This version of #{pact_broker_name} does not support branch versions,or you do not have the required permissions to create one. Please ensure you have upgraded to version 2.82.0 or later for branch support.")
    end
  end

  if tags
    create_version_tags
  end

  if !branch_name && !tags.any?
    create_version
  end

  PactBroker::Client::CommandResult.new(true, result_message)
end