-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add updating screenshots functionality.
Add ability to enter screenshot name while capturing from floating button.
- Loading branch information
1 parent
50b9006
commit 9e2054d
Showing
9 changed files
with
456 additions
and
26 deletions.
There are no files selected for viewing
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
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
149 changes: 149 additions & 0 deletions
149
Sources/CrowdinSDK/CrowdinAPI/ScreenshotsAPI/Models/ScreenshotsListResponse.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,149 @@ | ||
// | ||
// ScreenshotsListResponse.swift | ||
// Pods | ||
// | ||
// Created by Serhii Londar on 10.11.2024. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - ScreenshotsListResponse | ||
struct ScreenshotsListResponse: Codable, Hashable { | ||
let data: [ScreenshotsListResponseDatum] | ||
let pagination: ScreenshotsListResponsePagination | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case data = "data" | ||
case pagination = "pagination" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponseDatum | ||
struct ScreenshotsListResponseDatum: Codable, Hashable { | ||
let data: ScreenshotsListResponseData | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case data = "data" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponseData | ||
struct ScreenshotsListResponseData: Codable, Hashable { | ||
let id: Int | ||
let userID: Int | ||
let url: String | ||
let webURL: String | ||
let name: String | ||
let size: ScreenshotsListResponseSize | ||
let tagsCount: Int | ||
let tags: [ScreenshotsListResponseTag] | ||
let labels: [Int] | ||
let labelIDS: [Int] | ||
let createdAt: String | ||
let updatedAt: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id = "id" | ||
case userID = "userId" | ||
case url = "url" | ||
case webURL = "webUrl" | ||
case name = "name" | ||
case size = "size" | ||
case tagsCount = "tagsCount" | ||
case tags = "tags" | ||
case labels = "labels" | ||
case labelIDS = "labelIds" | ||
case createdAt = "createdAt" | ||
case updatedAt = "updatedAt" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponseSize | ||
struct ScreenshotsListResponseSize: Codable, Hashable { | ||
let width: Int | ||
let height: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case width = "width" | ||
case height = "height" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponseTag | ||
struct ScreenshotsListResponseTag: Codable, Hashable { | ||
let id: Int | ||
let screenshotID: Int | ||
let stringID: Int | ||
let position: ScreenshotsListResponsePosition | ||
let createdAt: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id = "id" | ||
case screenshotID = "screenshotId" | ||
case stringID = "stringId" | ||
case position = "position" | ||
case createdAt = "createdAt" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponsePosition | ||
struct ScreenshotsListResponsePosition: Codable, Hashable { | ||
let x: Int | ||
let y: Int | ||
let width: Int | ||
let height: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case x = "x" | ||
case y = "y" | ||
case width = "width" | ||
case height = "height" | ||
} | ||
} | ||
|
||
// | ||
// Hashable or Equatable: | ||
// The compiler will not be able to synthesize the implementation of Hashable or Equatable | ||
// for types that require the use of JSONAny, nor will the implementation of Hashable be | ||
// synthesized for types that have collections (such as arrays or dictionaries). | ||
|
||
// MARK: - ScreenshotsListResponsePagination | ||
struct ScreenshotsListResponsePagination: Codable, Hashable { | ||
let offset: Int | ||
let limit: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case offset = "offset" | ||
case limit = "limit" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Sources/CrowdinSDK/CrowdinAPI/ScreenshotsAPI/Models/UpdateScreenshotRequest.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,13 @@ | ||
// | ||
// UpdateScreenshotRequest.swift | ||
// Pods | ||
// | ||
// Created by Serhii Londar on 09.11.2024. | ||
// | ||
|
||
|
||
struct UpdateScreenshotRequest: Codable { | ||
let storageId: Int | ||
let name: String | ||
var usePreviousTags: Bool = true | ||
} |
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
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
Oops, something went wrong.