Method: Line::Bot::V2::MessagingApi::ApiClient#get_group_member_count_with_http_info

Defined in:
lib/line/bot/v2/messaging_api/api/messaging_api_client.rb

#get_group_member_count_with_http_info(group_id:) ⇒ Array(Line::Bot::V2::MessagingApi::GroupMemberCountResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Get number of users in a group chat This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/count This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.



823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_client.rb', line 823

def get_group_member_count_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  group_id:
)
  path = "/v2/bot/group/{groupId}/members/count"
    .gsub(/{groupId}/, group_id.to_s)

  response = @http_client.get(
    path: path,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::MessagingApi::GroupMemberCountResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end