Module: ChatWork::InvitationLink

Defined in:
lib/chatwork/invitation_link.rb

Class Method Summary collapse

Class Method Details

.create(room_id:, code: nil, description: nil, need_acceptance: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash

Create invitation link

Examples:

response format

{
  "public": true,
  "url": "https://example.chatwork.com/g/unique-link-name",
  "need_acceptance": true,
  "description": "This is a public room for topic A."
}

Parameters:

  • room_id (Integer)
  • code (String) (defaults to: nil)

    link path (default. random string)

  • description (String) (defaults to: nil)

    description of link page

  • need_acceptance (Boolean) (defaults to: nil)

    Approval necessity. Whether participation requires administrator approval.

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)

Returns:

  • (Hashie::Mash)

See Also:



50
51
52
# File 'lib/chatwork/invitation_link.rb', line 50

def self.create(room_id:, code: nil, description: nil, need_acceptance: nil, &block)
  ChatWork.client.create_invitation_link(room_id: room_id, code: code, description: description, need_acceptance: need_acceptance, &block)
end

.destroy(room_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Delete invitation link

Examples:

response format

{
  "public": false
}

Parameters:

  • room_id (Integer)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)

Returns:

  • (Hashie::Mash)

See Also:



98
99
100
# File 'lib/chatwork/invitation_link.rb', line 98

def self.destroy(room_id:, &block)
  ChatWork.client.destroy_invitation_link(room_id: room_id, &block)
end

.get(room_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Get invitation link

Examples:

response format

{
  "public": true,
  "url": "https://example.chatwork.com/g/randomcode42",
  "need_acceptance": true,
  "description": "Link description text"
}

Parameters:

  • room_id (Integer)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)

Returns:

  • (Hashie::Mash)

See Also:



23
24
25
# File 'lib/chatwork/invitation_link.rb', line 23

def self.get(room_id:, &block)
  ChatWork.client.get_invitation_link(room_id: room_id, &block)
end

.update(room_id:, code: nil, description: nil, need_acceptance: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash

Update invitation link

Examples:

response format

{
  "public": true,
  "url": "https://example.chatwork.com/g/another_link_name",
  "need_acceptance": false,
  "description": "Public room for everybody"
}

Parameters:

  • room_id (Integer)
  • code (String) (defaults to: nil)

    link path (default. random string)

  • description (String) (defaults to: nil)

    description of link page

  • need_acceptance (Boolean) (defaults to: nil)

    Approval necessity. Whether participation requires administrator approval.

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)

Returns:

  • (Hashie::Mash)

See Also:



77
78
79
# File 'lib/chatwork/invitation_link.rb', line 77

def self.update(room_id:, code: nil, description: nil, need_acceptance: nil, &block)
  ChatWork.client.update_invitation_link(room_id: room_id, code: code, description: description, need_acceptance: need_acceptance, &block)
end