module StrawberryAPI::Client::ProjectCopyToStrategies

Public Instance Methods

create_project_copy_to_strategy(name:, destination:, format: 'plain', admin_only: true, includes: 'none', enabled: true, strategy_type: 'native', contents: 'both', delete_project: false) click to toggle source

Creates a project copy to strategy

@param [String] name @param [String] destination @param [String] format 'plain' @param [Boolean] admin_only true @param [String] includes 'none' @param [String] enabled true @param [String] strategy_type 'native' @param [String] contents 'both' @param [Boolean] delete_project false

@return [StrawberryAPI::ProjectCopyToStrategy] The created project copy to strategy

# File lib/strawberry_api/client/project_copy_to_strategies.rb, line 41
def create_project_copy_to_strategy(name:, destination:, format: 'plain', admin_only: true, includes: 'none', enabled: true, strategy_type: 'native', contents: 'both', delete_project: false)
  body = {
    name: name,
    destination: destination,
    format: format,
    admin_only: admin_only,
    enabled: enabled,
    contents: contents,
    includes: includes,
    delete_project: delete_project
  }.to_json
  
  data = post("/project_copy_to_strategies", body: body).parse['projectcopytostrategy']
  data.nil? ? nil : ProjectCopyToStrategy.new(data)
end
delete_project_copy_to_strategy(id:) click to toggle source

Deletes a project copy to strategy

@param [Integer] id Id of the project copy to strategy to delete

@return [Boolean>] Success

# File lib/strawberry_api/client/project_copy_to_strategies.rb, line 82
def delete_project_copy_to_strategy(id:)
  delete("/project_copy_to_strategies/#{id}").success?
end
project_copy_to_strategies() click to toggle source

Fetches all project copy to strategies

@return [Array<StrawberryAPI::ProjectCopyToStrategy>] A list of project copy to strategies

# File lib/strawberry_api/client/project_copy_to_strategies.rb, line 10
def project_copy_to_strategies
  get("/project_copy_to_strategies").parse['array']&.map do |project_copy_to_strategy|
    ProjectCopyToStrategy.new(project_copy_to_strategy)
  end
end
project_copy_to_strategy(id:) click to toggle source

Fetches a project copy to strategy

@param [Integer] id Id of the project copy to strategy to retrieve

@return [StrawberryAPI::ProjectCopyToStrategy] The fetched project copy to strategy

# File lib/strawberry_api/client/project_copy_to_strategies.rb, line 22
def project_copy_to_strategy(id:)
  data = get("/project_copy_to_strategies/#{id}").parse['projectcopytostrategy']
  data.nil? ? nil : ProjectCopyToStrategy.new(data)
end
update_project_copy_to_strategy(id:, **options) click to toggle source

Updates a project copy to trategy

@param [Integer] id Id of the user to update @option options [String] :username @option options [String] :firstname @option options [String] :lastname @option options [String] :password @option options [String] :role_id @option options [String] :user_matrix_attributes

@return [StrawberryAPI::ProjectCopyToStrategy] The updated project copy to strategy

# File lib/strawberry_api/client/project_copy_to_strategies.rb, line 69
def update_project_copy_to_strategy(id:, **options)
  body = args.to_json
  
  data = put("/project_copy_to_strategies/#{id}", body: body).parse['projectcopytostrategy']
  data.nil? ? nil : ProjectCopyToStrategy.new(data)
end