Sha256: 37a602540f900826c8d1f0016388869d04bdb410d6446e8f60639404e59afc1a

Contents?: true

Size: 1.55 KB

Versions: 27

Compression:

Stored size: 1.55 KB

Contents

require_relative '../model'
module Spaceship
  class ConnectAPI
    class User
      include Spaceship::ConnectAPI::Model

      attr_accessor :username
      attr_accessor :first_name
      attr_accessor :last_name
      attr_accessor :email
      attr_accessor :preferred_currency_territory
      attr_accessor :agreed_to_terms
      attr_accessor :roles
      attr_accessor :all_apps_visible
      attr_accessor :provisioning_allowed
      attr_accessor :email_vetting_required
      attr_accessor :notifications

      attr_mapping({
        "username" => "username",
        "firstName" => "first_name",
        "lastName" => "last_name",
        "email" => "email",
        "preferredCurrencyTerritory" => "preferred_currency_territory",
        "agreedToTerms" => "agreed_to_terms",
        "roles" => "roles",
        "allAppsVisible" => "all_apps_visible",
        "provisioningAllowed" => "provisioning_allowed",
        "emailVettingRequired" => "email_vetting_required",
        "notifications" => "notifications"
      })

      def self.type
        return "users"
      end

      #
      # API
      #

      def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
        client ||= Spaceship::ConnectAPI
        resps = client.get_users(filter: filter, includes: includes).all_pages
        return resps.flat_map(&:to_models)
      end

      def self.find(client: nil, email: nil, includes: nil)
        client ||= Spaceship::ConnectAPI
        return all(client: client, filter: { email: email }, includes: includes)
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fastlane-2.174.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.173.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.172.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.171.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.170.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.169.0 spaceship/lib/spaceship/connect_api/models/user.rb
fastlane-2.168.0 spaceship/lib/spaceship/connect_api/models/user.rb