spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb in fastlane-2.220.0 vs spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb in fastlane-2.221.0
- old
+ new
@@ -2,10 +2,14 @@
module Spaceship
class ConnectAPI
module Provisioning
module API
+ module Version
+ V1 = "v1"
+ end
+
def provisioning_request_client=(provisioning_request_client)
@provisioning_request_client = provisioning_request_client
end
def provisioning_request_client
@@ -17,16 +21,16 @@
# bundleIds
#
def get_bundle_ids(filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
- provisioning_request_client.get("bundleIds", params)
+ provisioning_request_client.get("#{Version::V1}/bundleIds", params)
end
def get_bundle_id(bundle_id_id: {}, includes: nil)
params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
- provisioning_request_client.get("bundleIds/#{bundle_id_id}", params)
+ provisioning_request_client.get("#{Version::V1}/bundleIds/#{bundle_id_id}", params)
end
def post_bundle_id(name:, platform:, identifier:, seed_id:)
attributes = {
name: name,
@@ -40,25 +44,25 @@
attributes: attributes,
type: "bundleIds"
}
}
- provisioning_request_client.post("bundleIds", body)
+ provisioning_request_client.post("#{Version::V1}/bundleIds", body)
end
#
# bundleIdCapability
#
def get_bundle_id_capabilities(bundle_id_id:, includes: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: limit, sort: sort)
- provisioning_request_client.get("bundleIds/#{bundle_id_id}/bundleIdCapabilities", params)
+ provisioning_request_client.get("#{Version::V1}/bundleIds/#{bundle_id_id}/bundleIdCapabilities", params)
end
def get_available_bundle_id_capabilities(bundle_id_id:)
params = provisioning_request_client.build_params(filter: { bundleId: bundle_id_id })
- provisioning_request_client.get("capabilities", params)
+ provisioning_request_client.get("#{Version::V1}/capabilities", params)
end
def post_bundle_id_capability(bundle_id_id:, capability_type:, settings: [])
body = {
data: {
@@ -81,20 +85,25 @@
}
}
}
}
}
- provisioning_request_client.post("bundleIdCapabilities", body)
+ provisioning_request_client.post("#{Version::V1}/bundleIdCapabilities", body)
end
def patch_bundle_id_capability(bundle_id_id:, seed_id:, enabled: false, capability_type:, settings: [])
body = {
data: {
type: "bundleIds",
id: bundle_id_id,
attributes: {
- teamId: seed_id
+ permissions: {
+ edit: true,
+ delete: true
+ },
+ seedId: seed_id,
+ teamId: provisioning_request_client.team_id
},
relationships: {
bundleIdCapabilities: {
data: [
{
@@ -116,62 +125,62 @@
}
}
}
}
- provisioning_request_client.patch("bundleIds/#{bundle_id_id}", body)
+ provisioning_request_client.patch("#{Version::V1}/bundleIds/#{bundle_id_id}", body)
end
def delete_bundle_id_capability(bundle_id_capability_id:)
- provisioning_request_client.delete("bundleIdCapabilities/#{bundle_id_capability_id}")
+ provisioning_request_client.delete("#{Version::V1}/bundleIdCapabilities/#{bundle_id_capability_id}")
end
#
# certificates
#
def get_certificates(profile_id: nil, filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
if profile_id.nil?
- provisioning_request_client.get("certificates", params)
+ provisioning_request_client.get("#{Version::V1}/certificates", params)
else
- provisioning_request_client.get("profiles/#{profile_id}/certificates", params)
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/certificates", params)
end
end
def get_certificate(certificate_id: nil, includes: nil)
params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
- provisioning_request_client.get("certificates/#{certificate_id}", params)
+ provisioning_request_client.get("#{Version::V1}/certificates/#{certificate_id}", params)
end
def post_certificate(attributes: {})
body = {
data: {
attributes: attributes,
type: "certificates"
}
}
- provisioning_request_client.post("certificates", body)
+ provisioning_request_client.post("#{Version::V1}/certificates", body)
end
def delete_certificate(certificate_id: nil)
raise "Certificate id is nil" if certificate_id.nil?
- provisioning_request_client.delete("certificates/#{certificate_id}")
+ provisioning_request_client.delete("#{Version::V1}/certificates/#{certificate_id}")
end
#
# devices
#
def get_devices(profile_id: nil, filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
if profile_id.nil?
- provisioning_request_client.get("devices", params)
+ provisioning_request_client.get("#{Version::V1}/devices", params)
else
- provisioning_request_client.get("profiles/#{profile_id}/devices", params)
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/devices", params)
end
end
def post_device(name: nil, platform: nil, udid: nil)
attributes = {
@@ -185,11 +194,11 @@
attributes: attributes,
type: "devices"
}
}
- provisioning_request_client.post("devices", body)
+ provisioning_request_client.post("#{Version::V1}/devices", body)
end
def patch_device(id: nil, status: nil, new_name: nil)
raise "Device id is nil" if id.nil?
@@ -204,20 +213,20 @@
id: id,
type: "devices"
}
}
- provisioning_request_client.patch("devices/#{id}", body)
+ provisioning_request_client.patch("#{Version::V1}/devices/#{id}", body)
end
#
# profiles
#
def get_profiles(filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
- provisioning_request_client.get("profiles", params)
+ provisioning_request_client.get("#{Version::V1}/profiles", params)
end
def post_profiles(bundle_id_id: nil, certificates: nil, devices: nil, attributes: {})
body = {
data: {
@@ -248,22 +257,22 @@
}
}
}
}
- provisioning_request_client.post("profiles", body)
+ provisioning_request_client.post("#{Version::V1}/profiles", body)
end
def get_profile_bundle_id(profile_id: nil)
raise "Profile id is nil" if profile_id.nil?
- provisioning_request_client.get("profiles/#{profile_id}/bundleId")
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/bundleId")
end
def delete_profile(profile_id: nil)
raise "Profile id is nil" if profile_id.nil?
- provisioning_request_client.delete("profiles/#{profile_id}")
+ provisioning_request_client.delete("#{Version::V1}/profiles/#{profile_id}")
end
end
end
end
end