module Deploygate::Client::Organizations

Request to organizations endpoints

Public Instance Methods

add_organization(org_name:, description: nil) click to toggle source

Create an organization. @see docs.deploygate.com/reference#organizations-index

@param org_name [String] Organization name @option description [String] Organization description @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 24
def add_organization(org_name:, description: nil)
  res = api.post '/api/organizations' do |request|
    request.params[:name] = org_name
    request.params[:description] = description
  end
  Response.new(res)
end
add_organization_member(org_name:, user_name:) click to toggle source

Add members to the organization. @see docs.deploygate.com/reference#organizations-members-create

@param org_name [String] Organization name @param user_name [String] User name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 81
def add_organization_member(org_name:, user_name:)
  res = api.post "/api/organizations/#{org_name}/members" do |request|
    request.params[:username] = user_name
  end
  Response.new(res)
end
add_organization_member_by_email(org_name:, email:) click to toggle source

Add members to the organization. @see docs.deploygate.com/reference#organizations-members-create

@param org_name [String] Organization name @param email [String] User email @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 94
def add_organization_member_by_email(org_name:, email:)
  res = api.post "/api/organizations/#{org_name}/members" do |request|
    request.params[:email] = email
  end
  Response.new(res)
end
add_team_member(org_name:, team_name:, user_name:) click to toggle source

Add members to the team. @see docs.deploygate.com/reference#organizations-teams-users-create

@param org_name [String] Organization name @param team_name [String] Team name @param user_name [String] User name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 147
def add_team_member(org_name:, team_name:, user_name:)
  endpoint = "/api/organizations/#{org_name}/teams/#{team_name}/users"
  res = api.post endpoint do |request|
    request.params[:user] = user_name
  end
  Response.new(res)
end
delete_organization(org_name:) click to toggle source

Delete organization information. @see docs.deploygate.com/reference#organizations-destroy

@param org_name [String] Organization name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 60
def delete_organization(org_name:)
  res = api.delete "/api/organizations/#{org_name}"
  Response.new(res)
end
delete_organization_member(org_name:, user_name:) click to toggle source

Delete members to the organization. @see docs.deploygate.com/reference#organizations-members-destroy

@param org_name [String] Organization name @param user_name [String] User name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 107
def delete_organization_member(org_name:, user_name:)
  endpoint = "/api/organizations/#{org_name}/members/#{user_name}"
  res = api.delete endpoint do |request|
    request.params[:id] = user_name
  end
  Response.new(res)
end
delete_organization_member_by_email(org_name:, email:) click to toggle source

Delete members from the organization. @see docs.deploygate.com/reference#organizations-members-destroy

@param org_name [String] Organization name @param email [String] User email @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 121
def delete_organization_member_by_email(org_name:, email:)
  endpoint = "/api/organizations/#{org_name}/members/#{email}"
  res = api.delete endpoint do |request|
    request.params[:id] = email
  end
  Response.new(res)
end
delete_team_member(org_name:, team_name:, user_name:) click to toggle source

Delete members from the team. @see docs.deploygate.com/reference#organizations-teams-users-destroy

@param org_name [String] Organization name @param team_name [String] Team name @param user_name [String] User name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 162
def delete_team_member(org_name:, team_name:, user_name:)
  endpoint = "/api/organizations/#{org_name}/teams/#{team_name}/users/#{user_name}"
  res = api.delete endpoint
  Response.new(res)
end
organization(org_name:) click to toggle source

Get organization information. @see docs.deploygate.com/reference#organizations-show

@param org_name [String] Organization name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 37
def organization(org_name:)
  res = api.get "/api/organizations/#{org_name}"
  Response.new(res)
end
organization_members(org_name:) click to toggle source

Get a list of organization members. @see docs.deploygate.com/reference#organizations-members-index

@param org_name [String] Organization name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 70
def organization_members(org_name:)
  res = api.get "/api/organizations/#{org_name}/members"
  Response.new(res)
end
organizations() click to toggle source

Get a list of organizations. @see docs.deploygate.com/reference#organizations-index

@return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 13
def organizations
  res = api.get '/api/organizations'
  Response.new(res)
end
team_members(org_name:, team_name:) click to toggle source

Get a list of team members. @see docs.deploygate.com/reference#organizations-teams-users-index

@param org_name [String] Organization name @param team_name [String] Team name @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 135
def team_members(org_name:, team_name:)
  res = api.get "/api/organizations/#{org_name}/teams/#{team_name}/users"
  Response.new(res)
end
update_organization(org_name:, description: nil) click to toggle source

Update organization information. @see docs.deploygate.com/reference#organizations-update

@param org_name [String] Organization name @option description [String] Organization description @return [Deploygate::Client::Response]

# File lib/deploygate/client/organizations.rb, line 48
def update_organization(org_name:, description: nil)
  res = api.patch "/api/organizations/#{org_name}" do |request|
    request.params[:description] = description
  end
  Response.new(res)
end