Sha256: 2e3393af28b2a15a5cc762f28dd0116f1ea1dba4b5553f5f8b92a0c1540c3531

Contents?: true

Size: 485 Bytes

Versions: 15

Compression:

Stored size: 485 Bytes

Contents

class Zendesk2::Client::GetUserOrganizations < Zendesk2::Client::Request
  request_method :get
  request_path { |r| "/users/#{r.user_id}/organizations.json" }

  page_params!

  def user_id
    params.fetch("user_id").to_i
  end

  def mock
    memberships = self.data[:memberships].values.select { |m| m["user_id"] == user_id }
    organizations = memberships.map { |m| self.data[:organizations].fetch(m["organization_id"]) }

    page(organizations, root: "organizations")
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
zendesk2-1.7.5 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.7.4 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.7.2 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.7.1 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.7.0 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.6.1 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.17 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.16 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.15 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.14 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.13 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.12 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.11 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.10 lib/zendesk2/client/requests/get_user_organizations.rb
zendesk2-1.5.9 lib/zendesk2/client/requests/get_user_organizations.rb