Sha256: 309fea3c7fbce62138ef56e46b2f8ca59d824b5e9f6de64ec9d3679979a5298e

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

require_relative 'tunes_base'
module Spaceship
  module Tunes
    class B2bOrganization < TunesBase
      # @return (String) add or remove
      attr_accessor :type

      # @return (String) customer id
      attr_accessor :dep_customer_id

      # @return (String) organization id
      attr_accessor :dep_organization_id

      # @return (String) organization name
      attr_accessor :name

      # enum for types
      class TYPE
        ADD = "ADD"
        REMOVE = "REMOVE"
        NO_CHANGE = "NO_CHANGE"
      end

      attr_mapping(
        'value.type' => :type,
        'value.depCustomerId' => :dep_customer_id,
        'value.organizationId' => :dep_organization_id,
        'value.name' => :name
      )

      def self.from_id_info(dep_id: nil, dep_org_id: nil, dep_name: nil, type: TYPE::NO_CHANGE)
        self.new({ "value" => { "type" => type, "depCustomerId" => dep_id, "organizationId" => dep_org_id, "name" => dep_name } })
      end

      def ==(other)
        other.class == self.class && other.state == self.state
      end

      def state
        return [type, dep_customer_id, name]
      end

      alias eql? ==

      def hash
        state.hash
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 spaceship/lib/spaceship/tunes/b2b_organization.rb
fastlane_hotfix-2.165.0 spaceship/lib/spaceship/tunes/b2b_organization.rb
fastlane_hotfix-2.187.0 spaceship/lib/spaceship/tunes/b2b_organization.rb