Class: Spaceship::ConnectAPI::BundleIdCapability

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb

Defined Under Namespace

Modules: Options, Settings, Type

Instance Attribute Summary collapse

Attributes included from Model

#id, #reverse_attr_map

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes

Instance Attribute Details

#capability_typeObject

Returns the value of attribute capability_type.



7
8
9
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 7

def capability_type
  @capability_type
end

#settingsObject

Returns the value of attribute settings.



8
9
10
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 8

def settings
  @settings
end

Class Method Details

.all(client: nil, bundle_id_id:, limit: nil) ⇒ Object

API



118
119
120
121
122
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 118

def self.all(client: nil, bundle_id_id:, limit: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_bundle_id_capabilities(bundle_id_id: bundle_id_id, limit: limit).all_pages
  return resp.flat_map(&:to_models)
end

.create(client: nil, bundle_id_id:, capability_type:, settings: []) ⇒ Object



124
125
126
127
128
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 124

def self.create(client: nil, bundle_id_id:, capability_type:, settings: [])
  client ||= Spaceship::ConnectAPI
  resp = client.post_bundle_id_capability(bundle_id_id: bundle_id_id, capability_type: capability_type, settings: settings)
  return resp.to_models.first
end

.typeObject



100
101
102
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 100

def self.type
  return "bundleIdCapabilities"
end

Instance Method Details

#delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object



130
131
132
133
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 130

def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  client ||= Spaceship::ConnectAPI
  client.delete_bundle_id_capability(bundle_id_capability_id: id)
end

#is_type?(type) ⇒ Boolean

Helpers

Returns:

  • (Boolean)


108
109
110
111
112
# File 'spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb', line 108

def is_type?(type)
  # JWT session returns type under "capability_type" attribute
  # Web session returns type under "id" attribute but with "P7GJR49W72_" prefixed
  return capability_type == type || id.end_with?(type)
end