-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented endpoints for modifying and removing Bundle IDs #60
Closed
Closed
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac4d628
Implemented Modify Bundle ID endpoint
ruipfcosta 79d65c5
Fixed modify endpoint path.
ruipfcosta 8cda8b0
Implemented Remove Bundle ID endpoint.
ruipfcosta c9749e4
API tweaks.
ruipfcosta 3444948
Added documentation.
ruipfcosta 86fc68f
Improved documentation.
ruipfcosta cf1b7be
Minor tweaks
ruipfcosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
Sources/Endpoints/Provisioning/Bundle IDs/ModifyBundleID.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// ModifyBundleID.swift | ||
// AppStoreConnect-Swift-SDK | ||
// | ||
// Created by Rui Costa on 30/12/2019. | ||
// | ||
|
||
import Foundation | ||
|
||
extension APIEndpoint where T == BundleIdResponse { | ||
|
||
/// Update a specific bundle ID’s name | ||
/// - Parameter id: the bundle ID's id | ||
/// - Parameter name: the bundle ID's name | ||
public static func modify( | ||
bundleIdWithId id: String, | ||
name: String) -> APIEndpoint { | ||
|
||
let request = BundleIdUpdateRequest(data: .init( | ||
id: id, | ||
attributes: .init(name: name))) | ||
|
||
return APIEndpoint( | ||
path: "bundleIds/\(id)", | ||
method: .patch, | ||
parameters: nil, | ||
body: try? JSONEncoder().encode(request)) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Sources/Endpoints/Provisioning/Bundle IDs/RemoveBundleID.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// RemoveBundleID.swift | ||
// AppStoreConnect-Swift-SDK | ||
// | ||
// Created by Rui Costa on 30/12/2019. | ||
// | ||
|
||
import Foundation | ||
|
||
extension APIEndpoint where T == Void { | ||
|
||
/// Delete a bundle ID that is used for app development. | ||
/// - Parameter id: the bundle ID's id | ||
public static func remove(bundleIdWithId id: String) -> APIEndpoint { | ||
return APIEndpoint( | ||
path: "bundleIds/\(id)", | ||
method: .delete, | ||
parameters: nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,31 @@ | ||||
// | ||||
// BundleIdUpdateRequest.swift | ||||
// AppStoreConnect-Swift-SDK | ||||
// | ||||
// Created by Rui Costa on 30/12/2019. | ||||
// | ||||
|
||||
|
||||
import Foundation | ||||
|
||||
/// A request containing a single resource. | ||||
public struct BundleIdUpdateRequest: Encodable { | ||||
|
||||
/// The resource data. | ||||
public let data: Data | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
|
||||
public struct Data: Encodable { | ||||
public let id: String | ||||
public let attributes: Attributes | ||||
public let type: String = "bundleIds" | ||||
} | ||||
} | ||||
|
||||
// MARK: BundleIdUpdateRequest.Data | ||||
extension BundleIdUpdateRequest.Data { | ||||
|
||||
public struct Attributes: Encodable { | ||||
public let name: String | ||||
} | ||||
} | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vertical_whitespace
BundleIdUpdateRequest.swift:8