diff --git a/.buildkite/commands/validate-pods.sh b/.buildkite/commands/validate-pods.sh
index a3228ecb..70536f10 100644
--- a/.buildkite/commands/validate-pods.sh
+++ b/.buildkite/commands/validate-pods.sh
@@ -5,3 +5,6 @@ validate_podspec --allow-warnings Gravatar.podspec
echo "--- :cocoapods: Validate GravatarUI.podspec"
validate_podspec --allow-warnings GravatarUI.podspec
+
+echo "--- :cocoapods: Validate GravatarOpenAPIClient.podspec"
+validate_podspec --allow-warnings GravatarOpenAPIClient.podspec
diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index dccdfdef..86e1e3a6 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -44,6 +44,7 @@ steps:
command: |
.buildkite/commands/publish-pod.sh "Gravatar.podspec"
.buildkite/commands/publish-pod.sh "GravatarUI.podspec"
+ .buildkite/commands/publish-pod.sh "GravatarOpenAPIClient.podspec"
plugins: [$CI_TOOLKIT]
depends_on:
- "test"
diff --git a/.gitignore b/.gitignore
index 6b6b275c..e8b99e89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,9 +45,18 @@ fastlane/README.md
fastlane/report.xml
fastlane/test_output
+# OpenAPI
+openapi/GravatarOpenAPIClient/
+!openapi/GravatarOpenAPIClient/.openapi-generator/
+!openapi/GravatarOpenAPIClient/.openapi-generator-ignore
+!openapi/GravatarOpenAPIClient/docs/
+!openapi/GravatarOpenAPIClient/GravatarOpenAPIClient.podspec
+!openapi/GravatarOpenAPIClient/Package.swift
+!openapi/GravatarOpenAPIClient/project.yml
+!openapi/GravatarOpenAPIClient/README.md
+
# SwiftGen (part of wpmreleasetoolkit)
vendor/swiftgen
# Other
-openapi-generator/
Demo/Demo/Secrets.swift
diff --git a/Demo/Gravatar-Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/Gravatar-Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 25fedc2e..17c22476 100644
--- a/Demo/Gravatar-Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Demo/Gravatar-Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -1,5 +1,5 @@
{
- "originHash" : "89aad130e119d7a4b1dea1ad42b23e52b29cf016999eed5d14af43b0dc276ac1",
+ "originHash" : "bf24fbca0585c9e7707869442e833d48e8fbe49f5e904fe58370244d9f54521e",
"pins" : [
{
"identity" : "swift-snapshot-testing",
diff --git a/Gravatar.podspec b/Gravatar.podspec
index 03229947..dfa958a4 100644
--- a/Gravatar.podspec
+++ b/Gravatar.podspec
@@ -18,10 +18,11 @@ Pod::Spec.new do |s|
s.swift_versions = Gravatar::SWIFT_VERSIONS
- ios_deployment_target = '15.0'
+ ios_deployment_target = Gravatar::IOS_DEPLOYMENT_TARGET
s.ios.deployment_target = ios_deployment_target
+ s.dependency 'GravatarOpenAPIClient', s.version.to_s
s.source_files = 'Sources/Gravatar/**/*.swift'
s.resource_bundles = {
'Gravatar' => ['Sources/Gravatar/Resources/*.plist']
diff --git a/GravatarOpenAPIClient.podspec b/GravatarOpenAPIClient.podspec
new file mode 100644
index 00000000..3dd802f1
--- /dev/null
+++ b/GravatarOpenAPIClient.podspec
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require_relative 'version'
+
+Pod::Spec.new do |s|
+ s.name = 'GravatarOpenAPIClient'
+ s.summary = 'A Gravatar OpenAPI Client'
+ s.version = Gravatar::VERSION
+
+ s.swift_versions = Gravatar::SWIFT_VERSIONS
+
+ # Match the deployment target of Gravatar in order to satisfy `pod lib lint`
+ s.ios.deployment_target = Gravatar::IOS_DEPLOYMENT_TARGET
+
+ s.homepage = 'https://gravatar.com'
+ s.license = { type: 'Mozilla Public License v2', file: 'LICENSE.md' }
+ s.authors = 'Automattic, Inc.'
+ s.source = { :git => 'https://github.com/Automattic/Gravatar-SDK-iOS.git', :tag => s.version.to_s }
+
+ s.documentation_url = 'https://automattic.github.io/Gravatar-SDK-iOS/gravatar'
+
+ s.source_files = 'Sources/GravatarOpenAPIClient/**/*.swift'
+end
diff --git a/GravatarUI.podspec b/GravatarUI.podspec
index f16fed4f..b1cafb73 100644
--- a/GravatarUI.podspec
+++ b/GravatarUI.podspec
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.swift_versions = Gravatar::SWIFT_VERSIONS
- ios_deployment_target = '15.0'
+ ios_deployment_target = Gravatar::IOS_DEPLOYMENT_TARGET
s.ios.deployment_target = ios_deployment_target
s.source_files = 'Sources/GravatarUI/**/*.swift'
diff --git a/Makefile b/Makefile
index 4e7bafd2..e53a4000 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,15 @@ SWIFTFORMAT_CACHE = ~/Library/Caches/com.charcoaldesign.swiftformat
OPENAPI_GENERATOR_GIT_URL ?= https://github.com/openapitools/openapi-generator
OPENAPI_GENERATOR_GIT_TAG ?= v7.5.0
OPENAPI_GENERATOR_CLONE_DIR ?= $(CURRENT_MAKEFILE_DIR)/openapi-generator
+
+OPENAPI_PROJECT_NAME ?= GravatarOpenAPIClient
+OPENAPI_DIR ?= $(CURRENT_MAKEFILE_DIR)/$(OPENAPI_REL_DIR)
+OPENAPI_REL_DIR ?= openapi
+OPENAPI_GENERATED_DIR ?= $(CURRENT_MAKEFILE_DIR)/openapi/$(OPENAPI_PROJECT_NAME)
+OPENAPI_CLIENT_PROPERTIES ?= projectName=$(OPENAPI_PROJECT_NAME),useSPMFileStructure=true
+
OPENAPI_YAML_PATH ?= $(CURRENT_MAKEFILE_DIR)/openapi/spec.yaml
MODEL_TEMPLATE_PATH ?= $(CURRENT_MAKEFILE_DIR)/openapi
-OUTPUT_DIRECTORY ?= $(CURRENT_MAKEFILE_DIR)/Sources/Gravatar/OpenApi/Generated
# Derived values (don't change these).
CURRENT_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
@@ -94,7 +100,7 @@ validate-pod: bundle-install
xcrun simctl list >> /dev/null
bundle exec pod lib lint \
--include-podspecs="*.podspec" \
- --verbose --fail-fast
+ --verbose --fail-fast --allow-warnings
update-example-snapshots:
for filePath in ./Sources/GravatarUI/GravatarUI.docc/Resources/ProfileExamples/*; \
@@ -104,24 +110,19 @@ update-example-snapshots:
cd ./Sources/GravatarUI/GravatarUI.docc/Resources/ProfileExamples && \
for filePath in *; do name=$${filePath%.*}; mv $$filePath $${name//-dark/~dark}@2x$${filePath#$$name}; done
-install-and-generate: $(OPENAPI_GENERATOR_CLONE_DIR) # Clones and setup the openapi-generator.
- "$(OPENAPI_GENERATOR_CLONE_DIR)"/run-in-docker.sh mvn package
- make generate
-
-generate: $(OUTPUT_DIRECTORY) # Generates the open-api model
- cp "$(OPENAPI_YAML_PATH)" "$(OPENAPI_GENERATOR_CLONE_DIR)"/openapi.yaml
- mkdir -p "$(OPENAPI_GENERATOR_CLONE_DIR)"/templates
- cp "$(MODEL_TEMPLATE_PATH)"/*.mustache "$(OPENAPI_GENERATOR_CLONE_DIR)"/templates/
- rm -rf "$(OPENAPI_GENERATOR_CLONE_DIR)"/generated/OpenAPIClient/Classes/OpenAPIs/Models/*
- "$(OPENAPI_GENERATOR_CLONE_DIR)"/run-in-docker.sh generate -i openapi.yaml \
- --global-property models \
- -t templates \
- -g swift5 \
- -o ./generated \
- -p packageName=Gravatar \
- --additional-properties=useJsonEncodable=false,readonlyProperties=true && \
- rsync -av --delete "$(OPENAPI_GENERATOR_CLONE_DIR)"/generated/OpenAPIClient/Classes/OpenAPIs/Models/ "$(OUTPUT_DIRECTORY)/" && \
- make swiftformat && \
+generate: $(OPENAPI_GENERATED_DIR) # Generates the open-api model
+ rm -rf "$(OPENAPI_GENERATED_DIR)"/* && \
+ docker run --rm \
+ -v $(OPENAPI_DIR):/local openapitools/openapi-generator-cli:"$(OPENAPI_GENERATOR_GIT_TAG)" generate \
+ -i /local/openapi.yaml \
+ -o /local/GravatarOpenAPIClient \
+ -t /local/templates \
+ -g swift5 \
+ -p packageName=Gravatar \
+ --additional-properties=useJsonEncodable=false,readonlyProperties=true,$(OPENAPI_CLIENT_PROPERTIES) && \
+ rsync -av --delete "$(OPENAPI_GENERATED_DIR)/Sources/$(OPENAPI_PROJECT_NAME)/" "$(CURRENT_MAKEFILE_DIR)/Sources/$(OPENAPI_PROJECT_NAME)/" && \
+ cp -fp "$(OPENAPI_GENERATED_DIR)/$(OPENAPI_PROJECT_NAME).podspec" "$(CURRENT_MAKEFILE_DIR)/" && \
+ make swiftformat && \
echo "DONE! 🎉"
generate-strings: bundle-install
@@ -131,22 +132,22 @@ download-strings: bundle-install
bundle exec fastlane download_localized_strings
clean-generated: # Delete the output directory used for generated sources.
- @echo 'Delete entire directory: $(OUTPUT_DIRECTORY)? [y/N] ' && read ans && [ $${ans:-N} = y ] || (echo "Aborted"; exit 1)
- rm -rf "$(OUTPUT_DIRECTORY)"
+ @echo 'Delete entire directory: $(OPENAPI_GENERATED_DIR)? [y/N] ' && read ans && [ $${ans:-N} = y ] || (echo "Aborted"; exit 1)
+ rm -rf "$(OPENAPI_GENERATED_DIR)"
-clean: # Clean everything, including the checkout of swift-openapi-generator.
+clean: # Clean everything
@echo 'Delete checkout of openapi-generator $(OPENAPI_GENERATOR_CLONE_DIR)? [y/N] ' && read ans && [ $${ans:-N} = y ] || (echo "Aborted"; exit 1)
- rm -rf "$(OPENAPI_GENERATOR_CLONE_DIR)"
+ rm -rf "$(OPENAPI_GENERATOR_CLONE_DIR)/*"
dump: # Dump all derived values used by the Makefile.
@echo "CURRENT_MAKEFILE_PATH = $(CURRENT_MAKEFILE_PATH)"
@echo "CURRENT_MAKEFILE_DIR = $(CURRENT_MAKEFILE_DIR)"
+ @echo "OPENAPI_GENERATED_DIR = $(OPENAPI_GENERATED_DIR)"
@echo "OPENAPI_GENERATOR_GIT_URL = $(OPENAPI_GENERATOR_GIT_URL)"
@echo "OPENAPI_GENERATOR_GIT_TAG = $(OPENAPI_GENERATOR_GIT_TAG)"
@echo "OPENAPI_GENERATOR_CLONE_DIR = $(OPENAPI_GENERATOR_CLONE_DIR)"
@echo "OPENAPI_YAML_PATH = $(OPENAPI_YAML_PATH)"
- @echo "OUTPUT_DIRECTORY = $(OUTPUT_DIRECTORY)"
$(OPENAPI_GENERATOR_CLONE_DIR):
git \
@@ -157,5 +158,5 @@ $(OPENAPI_GENERATOR_CLONE_DIR):
"$(OPENAPI_GENERATOR_GIT_URL)" \
$@
-$(OUTPUT_DIRECTORY):
+$(OPENAPI_GENERATED_DIR):
mkdir -p "$@"
diff --git a/Package.resolved b/Package.resolved
index f1e5bd25..a54e8877 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -1,5 +1,5 @@
{
- "originHash" : "2d82ed06a27431c1da79790f8b215b8abf6d2a7397f42f02e364c7a92f86a5ab",
+ "originHash" : "ce90f93a035f7d411d81060dce4cdc6d5bcbe81fce7d7260084532fa492ff797",
"pins" : [
{
"identity" : "swift-snapshot-testing",
diff --git a/Package.swift b/Package.swift
index 375317e6..f58f1841 100644
--- a/Package.swift
+++ b/Package.swift
@@ -25,13 +25,14 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.8.1"),
- .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", exact: "0.56.2"),
+ .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", exact: "0.56.2")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "Gravatar",
+ dependencies: ["GravatarOpenAPIClient"],
resources: [.process("Resources")],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
@@ -72,6 +73,12 @@ let package = Package(
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]
+ ),
+ .target(
+ name: "GravatarOpenAPIClient",
+ swiftSettings: [
+ .enableExperimentalFeature("StrictConcurrency")
+ ]
)
]
)
diff --git a/Sources/Gravatar/OpenAPIExports.swift b/Sources/Gravatar/OpenAPIExports.swift
new file mode 100644
index 00000000..e4bc953f
--- /dev/null
+++ b/Sources/Gravatar/OpenAPIExports.swift
@@ -0,0 +1,23 @@
+import GravatarOpenAPIClient
+
+// MARK: OpenAPI Models: Public
+
+public typealias CryptoWalletAddress = GravatarOpenAPIClient.CryptoWalletAddress
+public typealias GalleryImage = GravatarOpenAPIClient.GalleryImage
+public typealias Interest = GravatarOpenAPIClient.Interest
+public typealias Language = GravatarOpenAPIClient.Language
+public typealias Link = GravatarOpenAPIClient.Link
+public typealias Profile = GravatarOpenAPIClient.Profile
+public typealias ProfileContactInfo = GravatarOpenAPIClient.ProfileContactInfo
+public typealias ProfilePayments = GravatarOpenAPIClient.ProfilePayments
+public typealias VerifiedAccount = GravatarOpenAPIClient.VerifiedAccount
+
+// MARK: - OpenAPI Models: Package
+
+package typealias Avatar = GravatarOpenAPIClient.Avatar
+
+// MARK: - OpenAPI Models: Internal
+
+typealias AssociatedResponse = GravatarOpenAPIClient.AssociatedResponse
+typealias ModelError = GravatarOpenAPIClient.ModelError
+typealias SetEmailAvatarRequest = GravatarOpenAPIClient.SetEmailAvatarRequest
diff --git a/Sources/Gravatar/OpenApi/Generated/AssociatedResponse.swift b/Sources/GravatarOpenAPIClient/Models/AssociatedResponse.swift
similarity index 71%
rename from Sources/Gravatar/OpenApi/Generated/AssociatedResponse.swift
rename to Sources/GravatarOpenAPIClient/Models/AssociatedResponse.swift
index f5587bf0..83522be0 100644
--- a/Sources/Gravatar/OpenApi/Generated/AssociatedResponse.swift
+++ b/Sources/GravatarOpenAPIClient/Models/AssociatedResponse.swift
@@ -1,8 +1,8 @@
import Foundation
-struct AssociatedResponse: Codable, Hashable, Sendable {
+public struct AssociatedResponse: Codable, Hashable, Sendable {
/// Whether the entity is associated with the account.
- private(set) var associated: Bool
+ public private(set) var associated: Bool
init(associated: Bool) {
self.associated = associated
@@ -14,7 +14,7 @@ struct AssociatedResponse: Codable, Hashable, Sendable {
// Encodable protocol methods
- func encode(to encoder: Encoder) throws {
+ public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(associated, forKey: .associated)
}
diff --git a/Sources/Gravatar/OpenApi/Generated/Avatar.swift b/Sources/GravatarOpenAPIClient/Models/Avatar.swift
similarity index 71%
rename from Sources/Gravatar/OpenApi/Generated/Avatar.swift
rename to Sources/GravatarOpenAPIClient/Models/Avatar.swift
index 898b8758..d619396f 100644
--- a/Sources/Gravatar/OpenApi/Generated/Avatar.swift
+++ b/Sources/GravatarOpenAPIClient/Models/Avatar.swift
@@ -2,8 +2,8 @@ import Foundation
/// An avatar that the user has already uploaded to their Gravatar account.
///
-package struct Avatar: Codable, Hashable, Sendable {
- package enum Rating: String, Codable, CaseIterable, Sendable {
+public struct Avatar: Codable, Hashable, Sendable {
+ public enum Rating: String, Codable, CaseIterable, Sendable {
case g = "G"
case pg = "PG"
case r = "R"
@@ -11,19 +11,19 @@ package struct Avatar: Codable, Hashable, Sendable {
}
/// Unique identifier for the image.
- package private(set) var imageId: String
+ public private(set) var imageId: String
/// Image URL
- package private(set) var imageUrl: String
+ public private(set) var imageUrl: String
/// Rating associated with the image.
- package private(set) var rating: Rating
+ public private(set) var rating: Rating
/// Date and time when the image was last updated.
- package private(set) var updatedDate: Date
+ public private(set) var updatedDate: Date
/// Alternative text description of the image.
- package private(set) var altText: String
+ public private(set) var altText: String
/// Whether the image is currently selected as the provided selected email's avatar.
- package private(set) var selected: Bool?
+ public private(set) var selected: Bool?
- package init(imageId: String, imageUrl: String, rating: Rating, updatedDate: Date, altText: String, selected: Bool? = nil) {
+ init(imageId: String, imageUrl: String, rating: Rating, updatedDate: Date, altText: String, selected: Bool? = nil) {
self.imageId = imageId
self.imageUrl = imageUrl
self.rating = rating
@@ -43,7 +43,7 @@ package struct Avatar: Codable, Hashable, Sendable {
// Encodable protocol methods
- package func encode(to encoder: Encoder) throws {
+ public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(imageId, forKey: .imageId)
try container.encode(imageUrl, forKey: .imageUrl)
diff --git a/Sources/Gravatar/OpenApi/Generated/CryptoWalletAddress.swift b/Sources/GravatarOpenAPIClient/Models/CryptoWalletAddress.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/CryptoWalletAddress.swift
rename to Sources/GravatarOpenAPIClient/Models/CryptoWalletAddress.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/GalleryImage.swift b/Sources/GravatarOpenAPIClient/Models/GalleryImage.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/GalleryImage.swift
rename to Sources/GravatarOpenAPIClient/Models/GalleryImage.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/Interest.swift b/Sources/GravatarOpenAPIClient/Models/Interest.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/Interest.swift
rename to Sources/GravatarOpenAPIClient/Models/Interest.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/Language.swift b/Sources/GravatarOpenAPIClient/Models/Language.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/Language.swift
rename to Sources/GravatarOpenAPIClient/Models/Language.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/Link.swift b/Sources/GravatarOpenAPIClient/Models/Link.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/Link.swift
rename to Sources/GravatarOpenAPIClient/Models/Link.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/ModelError.swift b/Sources/GravatarOpenAPIClient/Models/ModelError.swift
similarity index 74%
rename from Sources/Gravatar/OpenApi/Generated/ModelError.swift
rename to Sources/GravatarOpenAPIClient/Models/ModelError.swift
index b180a823..67fdfc07 100644
--- a/Sources/Gravatar/OpenApi/Generated/ModelError.swift
+++ b/Sources/GravatarOpenAPIClient/Models/ModelError.swift
@@ -2,11 +2,11 @@ import Foundation
/// An error response from the API.
///
-struct ModelError: Codable, Hashable, Sendable {
+public struct ModelError: Codable, Hashable, Sendable {
/// The error message
- private(set) var error: String
+ public private(set) var error: String
/// The error code for the error message
- private(set) var code: String?
+ public private(set) var code: String?
init(error: String, code: String? = nil) {
self.error = error
@@ -20,7 +20,7 @@ struct ModelError: Codable, Hashable, Sendable {
// Encodable protocol methods
- func encode(to encoder: Encoder) throws {
+ public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(error, forKey: .error)
try container.encodeIfPresent(code, forKey: .code)
diff --git a/Sources/Gravatar/OpenApi/Generated/Profile.swift b/Sources/GravatarOpenAPIClient/Models/Profile.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/Profile.swift
rename to Sources/GravatarOpenAPIClient/Models/Profile.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/ProfileContactInfo.swift b/Sources/GravatarOpenAPIClient/Models/ProfileContactInfo.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/ProfileContactInfo.swift
rename to Sources/GravatarOpenAPIClient/Models/ProfileContactInfo.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/ProfilePayments.swift b/Sources/GravatarOpenAPIClient/Models/ProfilePayments.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/ProfilePayments.swift
rename to Sources/GravatarOpenAPIClient/Models/ProfilePayments.swift
diff --git a/Sources/Gravatar/OpenApi/Generated/SetEmailAvatarRequest.swift b/Sources/GravatarOpenAPIClient/Models/SetEmailAvatarRequest.swift
similarity index 71%
rename from Sources/Gravatar/OpenApi/Generated/SetEmailAvatarRequest.swift
rename to Sources/GravatarOpenAPIClient/Models/SetEmailAvatarRequest.swift
index a2cb31a5..54ad2f69 100644
--- a/Sources/Gravatar/OpenApi/Generated/SetEmailAvatarRequest.swift
+++ b/Sources/GravatarOpenAPIClient/Models/SetEmailAvatarRequest.swift
@@ -1,8 +1,8 @@
import Foundation
-struct SetEmailAvatarRequest: Codable, Hashable, Sendable {
+public struct SetEmailAvatarRequest: Codable, Hashable, Sendable {
/// The email SHA256 hash to set the avatar for.
- private(set) var emailHash: String
+ public private(set) var emailHash: String
init(emailHash: String) {
self.emailHash = emailHash
@@ -14,7 +14,7 @@ struct SetEmailAvatarRequest: Codable, Hashable, Sendable {
// Encodable protocol methods
- func encode(to encoder: Encoder) throws {
+ public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(emailHash, forKey: .emailHash)
}
diff --git a/Sources/Gravatar/OpenApi/Generated/VerifiedAccount.swift b/Sources/GravatarOpenAPIClient/Models/VerifiedAccount.swift
similarity index 100%
rename from Sources/Gravatar/OpenApi/Generated/VerifiedAccount.swift
rename to Sources/GravatarOpenAPIClient/Models/VerifiedAccount.swift
diff --git a/openapi/GravatarOpenAPIClient/.openapi-generator-ignore b/openapi/GravatarOpenAPIClient/.openapi-generator-ignore
new file mode 100644
index 00000000..960c8197
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/.openapi-generator-ignore
@@ -0,0 +1,30 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
+
+.gitignore
+.swiftformat
+Cartfile
+git_push.sh
+Sources/GravatarOpenAPIClient/
+!Sources/GravatarOpenAPIClient/Models/
diff --git a/openapi/GravatarOpenAPIClient/.openapi-generator/FILES b/openapi/GravatarOpenAPIClient/.openapi-generator/FILES
new file mode 100644
index 00000000..f54bbde5
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/.openapi-generator/FILES
@@ -0,0 +1,32 @@
+GravatarOpenAPIClient.podspec
+Package.swift
+README.md
+Sources/GravatarOpenAPIClient/Models/AssociatedResponse.swift
+Sources/GravatarOpenAPIClient/Models/Avatar.swift
+Sources/GravatarOpenAPIClient/Models/CryptoWalletAddress.swift
+Sources/GravatarOpenAPIClient/Models/GalleryImage.swift
+Sources/GravatarOpenAPIClient/Models/Interest.swift
+Sources/GravatarOpenAPIClient/Models/Language.swift
+Sources/GravatarOpenAPIClient/Models/Link.swift
+Sources/GravatarOpenAPIClient/Models/ModelError.swift
+Sources/GravatarOpenAPIClient/Models/Profile.swift
+Sources/GravatarOpenAPIClient/Models/ProfileContactInfo.swift
+Sources/GravatarOpenAPIClient/Models/ProfilePayments.swift
+Sources/GravatarOpenAPIClient/Models/SetEmailAvatarRequest.swift
+Sources/GravatarOpenAPIClient/Models/VerifiedAccount.swift
+docs/AssociatedResponse.md
+docs/Avatar.md
+docs/AvatarsAPI.md
+docs/CryptoWalletAddress.md
+docs/GalleryImage.md
+docs/Interest.md
+docs/Language.md
+docs/Link.md
+docs/ModelError.md
+docs/Profile.md
+docs/ProfileContactInfo.md
+docs/ProfilePayments.md
+docs/ProfilesAPI.md
+docs/SetEmailAvatarRequest.md
+docs/VerifiedAccount.md
+project.yml
diff --git a/openapi/GravatarOpenAPIClient/.openapi-generator/VERSION b/openapi/GravatarOpenAPIClient/.openapi-generator/VERSION
new file mode 100644
index 00000000..18bb4182
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.5.0
diff --git a/openapi/GravatarOpenAPIClient/GravatarOpenAPIClient.podspec b/openapi/GravatarOpenAPIClient/GravatarOpenAPIClient.podspec
new file mode 100644
index 00000000..3dd802f1
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/GravatarOpenAPIClient.podspec
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require_relative 'version'
+
+Pod::Spec.new do |s|
+ s.name = 'GravatarOpenAPIClient'
+ s.summary = 'A Gravatar OpenAPI Client'
+ s.version = Gravatar::VERSION
+
+ s.swift_versions = Gravatar::SWIFT_VERSIONS
+
+ # Match the deployment target of Gravatar in order to satisfy `pod lib lint`
+ s.ios.deployment_target = Gravatar::IOS_DEPLOYMENT_TARGET
+
+ s.homepage = 'https://gravatar.com'
+ s.license = { type: 'Mozilla Public License v2', file: 'LICENSE.md' }
+ s.authors = 'Automattic, Inc.'
+ s.source = { :git => 'https://github.com/Automattic/Gravatar-SDK-iOS.git', :tag => s.version.to_s }
+
+ s.documentation_url = 'https://automattic.github.io/Gravatar-SDK-iOS/gravatar'
+
+ s.source_files = 'Sources/GravatarOpenAPIClient/**/*.swift'
+end
diff --git a/openapi/GravatarOpenAPIClient/Package.swift b/openapi/GravatarOpenAPIClient/Package.swift
new file mode 100644
index 00000000..b773c9f6
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/Package.swift
@@ -0,0 +1,33 @@
+// swift-tools-version:5.1
+
+import PackageDescription
+
+let package = Package(
+ name: "GravatarOpenAPIClient",
+ platforms: [
+ .iOS(.v11),
+ .macOS(.v10_13),
+ .tvOS(.v11),
+ .watchOS(.v4),
+ ],
+ products: [
+ // Products define the executables and libraries produced by a package, and make them visible to other packages.
+ .library(
+ name: "GravatarOpenAPIClient",
+ targets: ["GravatarOpenAPIClient"]
+ ),
+ ],
+ dependencies: [
+ // Dependencies declare other packages that this package depends on.
+ .package(url: "https://github.com/Flight-School/AnyCodable", .upToNextMajor(from: "0.6.1")),
+ ],
+ targets: [
+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
+ // Targets can depend on other targets in this package, and on products in packages which this package depends on.
+ .target(
+ name: "GravatarOpenAPIClient",
+ dependencies: ["AnyCodable", ],
+ path: "Sources/GravatarOpenAPIClient"
+ ),
+ ]
+)
diff --git a/openapi/GravatarOpenAPIClient/README.md b/openapi/GravatarOpenAPIClient/README.md
new file mode 100644
index 00000000..c31350d5
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/README.md
@@ -0,0 +1,76 @@
+# Swift5 API client for GravatarOpenAPIClient
+
+Gravatar's public API endpoints
+
+## Overview
+This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
+
+- API version: 3.0.0
+- Package version:
+- Generator version: 7.5.0
+- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen
+For more information, please visit [https://gravatar.com](https://gravatar.com)
+
+## Installation
+
+### Carthage
+
+Run `carthage update`
+
+### CocoaPods
+
+Run `pod install`
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://api.gravatar.com/v3*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AvatarsAPI* | [**getAvatars**](docs/AvatarsAPI.md#getavatars) | **GET** /me/avatars | List avatars
+*AvatarsAPI* | [**setEmailAvatar**](docs/AvatarsAPI.md#setemailavatar) | **POST** /me/avatars/{imageId}/email | Set avatar for the hashed email
+*AvatarsAPI* | [**uploadAvatar**](docs/AvatarsAPI.md#uploadavatar) | **POST** /me/avatars | Upload new avatar image
+*ProfilesAPI* | [**associatedEmail**](docs/ProfilesAPI.md#associatedemail) | **GET** /me/associated-email | Check if the email is associated with the authenticated user
+*ProfilesAPI* | [**getProfileById**](docs/ProfilesAPI.md#getprofilebyid) | **GET** /profiles/{profileIdentifier} | Get profile by identifier
+
+
+## Documentation For Models
+
+ - [AssociatedResponse](docs/AssociatedResponse.md)
+ - [Avatar](docs/Avatar.md)
+ - [CryptoWalletAddress](docs/CryptoWalletAddress.md)
+ - [GalleryImage](docs/GalleryImage.md)
+ - [Interest](docs/Interest.md)
+ - [Language](docs/Language.md)
+ - [Link](docs/Link.md)
+ - [ModelError](docs/ModelError.md)
+ - [Profile](docs/Profile.md)
+ - [ProfileContactInfo](docs/ProfileContactInfo.md)
+ - [ProfilePayments](docs/ProfilePayments.md)
+ - [SetEmailAvatarRequest](docs/SetEmailAvatarRequest.md)
+ - [VerifiedAccount](docs/VerifiedAccount.md)
+
+
+
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+
+### apiKey
+
+- **Type**: HTTP Bearer Token authentication
+
+
+### oauth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: https://public-api.wordpress.com/oauth2/authorize
+- **Scopes**: N/A
+
+
+## Author
+
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/AssociatedResponse.md b/openapi/GravatarOpenAPIClient/docs/AssociatedResponse.md
new file mode 100644
index 00000000..8c31021b
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/AssociatedResponse.md
@@ -0,0 +1,10 @@
+# AssociatedResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**associated** | **Bool** | Whether the entity is associated with the account. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/Avatar.md b/openapi/GravatarOpenAPIClient/docs/Avatar.md
new file mode 100644
index 00000000..65827a4d
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/Avatar.md
@@ -0,0 +1,15 @@
+# Avatar
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**imageId** | **String** | Unique identifier for the image. |
+**imageUrl** | **String** | Image URL |
+**rating** | **String** | Rating associated with the image. |
+**updatedDate** | **Date** | Date and time when the image was last updated. |
+**altText** | **String** | Alternative text description of the image. |
+**selected** | **Bool** | Whether the image is currently selected as the provided selected email's avatar. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/AvatarsAPI.md b/openapi/GravatarOpenAPIClient/docs/AvatarsAPI.md
new file mode 100644
index 00000000..aaf5a46f
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/AvatarsAPI.md
@@ -0,0 +1,163 @@
+# AvatarsAPI
+
+All URIs are relative to *https://api.gravatar.com/v3*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**getAvatars**](AvatarsAPI.md#getavatars) | **GET** /me/avatars | List avatars
+[**setEmailAvatar**](AvatarsAPI.md#setemailavatar) | **POST** /me/avatars/{imageId}/email | Set avatar for the hashed email
+[**uploadAvatar**](AvatarsAPI.md#uploadavatar) | **POST** /me/avatars | Upload new avatar image
+
+
+# **getAvatars**
+```swift
+ open class func getAvatars(selectedEmailHash: String? = nil, completion: @escaping (_ data: [Avatar]?, _ error: Error?) -> Void)
+```
+
+List avatars
+
+Retrieves a list of available avatars for the authenticated user.
+
+### Example
+```swift
+// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
+import GravatarOpenAPIClient
+
+let selectedEmailHash = "selectedEmailHash_example" // String | The sha256 hash of the email address used to determine which avatar is selected. The 'selected' attribute in the avatar list will be set to 'true' for the avatar associated with this email. (optional) (default to "null")
+
+// List avatars
+AvatarsAPI.getAvatars(selectedEmailHash: selectedEmailHash) { (response, error) in
+ guard error == nil else {
+ print(error)
+ return
+ }
+
+ if (response) {
+ dump(response)
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **selectedEmailHash** | **String** | The sha256 hash of the email address used to determine which avatar is selected. The 'selected' attribute in the avatar list will be set to 'true' for the avatar associated with this email. | [optional] [default to "null"]
+
+### Return type
+
+[**[Avatar]**](Avatar.md)
+
+### Authorization
+
+[oauth](../README.md#oauth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **setEmailAvatar**
+```swift
+ open class func setEmailAvatar(imageId: String, setEmailAvatarRequest: SetEmailAvatarRequest, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
+```
+
+Set avatar for the hashed email
+
+Sets the avatar for the provided email hash.
+
+### Example
+```swift
+// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
+import GravatarOpenAPIClient
+
+let imageId = "imageId_example" // String | Image ID of the avatar to set as the provided hashed email avatar.
+let setEmailAvatarRequest = setEmailAvatar_request(emailHash: "emailHash_example") // SetEmailAvatarRequest | Avatar selection details
+
+// Set avatar for the hashed email
+AvatarsAPI.setEmailAvatar(imageId: imageId, setEmailAvatarRequest: setEmailAvatarRequest) { (response, error) in
+ guard error == nil else {
+ print(error)
+ return
+ }
+
+ if (response) {
+ dump(response)
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **imageId** | **String** | Image ID of the avatar to set as the provided hashed email avatar. |
+ **setEmailAvatarRequest** | [**SetEmailAvatarRequest**](SetEmailAvatarRequest.md) | Avatar selection details |
+
+### Return type
+
+Void (empty response body)
+
+### Authorization
+
+[oauth](../README.md#oauth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **uploadAvatar**
+```swift
+ open class func uploadAvatar(data: URL, completion: @escaping (_ data: Avatar?, _ error: Error?) -> Void)
+```
+
+Upload new avatar image
+
+Uploads a new avatar image for the authenticated user.
+
+### Example
+```swift
+// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
+import GravatarOpenAPIClient
+
+let data = URL(string: "https://example.com")! // URL | The avatar image file
+
+// Upload new avatar image
+AvatarsAPI.uploadAvatar(data: data) { (response, error) in
+ guard error == nil else {
+ print(error)
+ return
+ }
+
+ if (response) {
+ dump(response)
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **data** | **URL** | The avatar image file |
+
+### Return type
+
+[**Avatar**](Avatar.md)
+
+### Authorization
+
+[oauth](../README.md#oauth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/openapi/GravatarOpenAPIClient/docs/CryptoWalletAddress.md b/openapi/GravatarOpenAPIClient/docs/CryptoWalletAddress.md
new file mode 100644
index 00000000..b295c2e1
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/CryptoWalletAddress.md
@@ -0,0 +1,11 @@
+# CryptoWalletAddress
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**label** | **String** | The label for the crypto currency. |
+**address** | **String** | The wallet address for the crypto currency. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/GalleryImage.md b/openapi/GravatarOpenAPIClient/docs/GalleryImage.md
new file mode 100644
index 00000000..c3055dd5
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/GalleryImage.md
@@ -0,0 +1,11 @@
+# GalleryImage
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **String** | The URL to the image. |
+**altText** | **String** | The image alt text. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/Interest.md b/openapi/GravatarOpenAPIClient/docs/Interest.md
new file mode 100644
index 00000000..fb2ec879
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/Interest.md
@@ -0,0 +1,11 @@
+# Interest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Int** | The unique identifier for the interest. |
+**name** | **String** | The name of the interest. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/Language.md b/openapi/GravatarOpenAPIClient/docs/Language.md
new file mode 100644
index 00000000..66fe7bd2
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/Language.md
@@ -0,0 +1,13 @@
+# Language
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **String** | The language code. |
+**name** | **String** | The language name. |
+**isPrimary** | **Bool** | Whether the language is the user's primary language. |
+**order** | **Int** | The order of the language in the user's profile. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/Link.md b/openapi/GravatarOpenAPIClient/docs/Link.md
new file mode 100644
index 00000000..6284ba35
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/Link.md
@@ -0,0 +1,11 @@
+# Link
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**label** | **String** | The label for the link. |
+**url** | **String** | The URL to the link. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/ModelError.md b/openapi/GravatarOpenAPIClient/docs/ModelError.md
new file mode 100644
index 00000000..4eb1b7d0
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/ModelError.md
@@ -0,0 +1,11 @@
+# ModelError
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **String** | The error message |
+**code** | **String** | The error code for the error message | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/Profile.md b/openapi/GravatarOpenAPIClient/docs/Profile.md
new file mode 100644
index 00000000..e546597f
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/Profile.md
@@ -0,0 +1,34 @@
+# Profile
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**hash** | **String** | The SHA256 hash of the user's primary email address. |
+**displayName** | **String** | The user's display name. This is the name that is displayed on their profile. |
+**profileUrl** | **String** | The full URL for the user's profile. |
+**avatarUrl** | **String** | The URL for the user's avatar image if it has been set. |
+**avatarAltText** | **String** | The alt text for the user's avatar image if it has been set. |
+**location** | **String** | The user's location. |
+**description** | **String** | The about section on a user's profile. |
+**jobTitle** | **String** | The user's job title. |
+**company** | **String** | The user's current company's name. |
+**verifiedAccounts** | [VerifiedAccount] | A list of verified accounts the user has added to their profile. This is limited to a max of 4 in unauthenticated requests. |
+**pronunciation** | **String** | The phonetic pronunciation of the user's name. |
+**pronouns** | **String** | The pronouns the user uses. |
+**timezone** | **String** | The timezone the user has. This is only provided in authenticated API requests. | [optional]
+**languages** | [Language] | The languages the user knows. This is only provided in authenticated API requests. | [optional]
+**firstName** | **String** | User's first name. This is only provided in authenticated API requests. | [optional]
+**lastName** | **String** | User's last name. This is only provided in authenticated API requests. | [optional]
+**isOrganization** | **Bool** | Whether user is an organization. This is only provided in authenticated API requests. | [optional]
+**links** | [Link] | A list of links the user has added to their profile. This is only provided in authenticated API requests. | [optional]
+**interests** | [Interest] | A list of interests the user has added to their profile. This is only provided in authenticated API requests. | [optional]
+**payments** | [**ProfilePayments**](ProfilePayments.md) | | [optional]
+**contactInfo** | [**ProfileContactInfo**](ProfileContactInfo.md) | | [optional]
+**gallery** | [GalleryImage] | Additional images a user has uploaded. This is only provided in authenticated API requests. | [optional]
+**numberVerifiedAccounts** | **Int** | The number of verified accounts the user has added to their profile. This count includes verified accounts the user is hiding from their profile. This is only provided in authenticated API requests. | [optional]
+**lastProfileEdit** | **Date** | The date and time (UTC) the user last edited their profile. This is only provided in authenticated API requests. | [optional]
+**registrationDate** | **Date** | The date the user registered their account. This is only provided in authenticated API requests. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/ProfileContactInfo.md b/openapi/GravatarOpenAPIClient/docs/ProfileContactInfo.md
new file mode 100644
index 00000000..9345950b
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/ProfileContactInfo.md
@@ -0,0 +1,15 @@
+# ProfileContactInfo
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**homePhone** | **String** | The user's home phone number. | [optional]
+**workPhone** | **String** | The user's work phone number. | [optional]
+**cellPhone** | **String** | The user's cell phone number. | [optional]
+**email** | **String** | The user's email address as provided on the contact section of the profile. Might differ from their account emails. | [optional]
+**contactForm** | **String** | The URL to the user's contact form. | [optional]
+**calendar** | **String** | The URL to the user's calendar. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/ProfilePayments.md b/openapi/GravatarOpenAPIClient/docs/ProfilePayments.md
new file mode 100644
index 00000000..880cf4fa
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/ProfilePayments.md
@@ -0,0 +1,11 @@
+# ProfilePayments
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**links** | [Link] | A list of payment URLs the user has added to their profile. |
+**cryptoWallets** | [CryptoWalletAddress] | A list of crypto currencies the user accepts. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/ProfilesAPI.md b/openapi/GravatarOpenAPIClient/docs/ProfilesAPI.md
new file mode 100644
index 00000000..39c79c09
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/ProfilesAPI.md
@@ -0,0 +1,110 @@
+# ProfilesAPI
+
+All URIs are relative to *https://api.gravatar.com/v3*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**associatedEmail**](ProfilesAPI.md#associatedemail) | **GET** /me/associated-email | Check if the email is associated with the authenticated user
+[**getProfileById**](ProfilesAPI.md#getprofilebyid) | **GET** /profiles/{profileIdentifier} | Get profile by identifier
+
+
+# **associatedEmail**
+```swift
+ open class func associatedEmail(emailHash: String, completion: @escaping (_ data: AssociatedResponse?, _ error: Error?) -> Void)
+```
+
+Check if the email is associated with the authenticated user
+
+Checks if the provided email address is associated with the authenticated user.
+
+### Example
+```swift
+// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
+import GravatarOpenAPIClient
+
+let emailHash = "emailHash_example" // String | The hash of the email address to check.
+
+// Check if the email is associated with the authenticated user
+ProfilesAPI.associatedEmail(emailHash: emailHash) { (response, error) in
+ guard error == nil else {
+ print(error)
+ return
+ }
+
+ if (response) {
+ dump(response)
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **emailHash** | **String** | The hash of the email address to check. |
+
+### Return type
+
+[**AssociatedResponse**](AssociatedResponse.md)
+
+### Authorization
+
+[oauth](../README.md#oauth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getProfileById**
+```swift
+ open class func getProfileById(profileIdentifier: String, completion: @escaping (_ data: Profile?, _ error: Error?) -> Void)
+```
+
+Get profile by identifier
+
+Returns a profile by the given identifier.
+
+### Example
+```swift
+// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
+import GravatarOpenAPIClient
+
+let profileIdentifier = "profileIdentifier_example" // String | This can either be an SHA256 hash of an email address or profile URL slug.
+
+// Get profile by identifier
+ProfilesAPI.getProfileById(profileIdentifier: profileIdentifier) { (response, error) in
+ guard error == nil else {
+ print(error)
+ return
+ }
+
+ if (response) {
+ dump(response)
+ }
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **profileIdentifier** | **String** | This can either be an SHA256 hash of an email address or profile URL slug. |
+
+### Return type
+
+[**Profile**](Profile.md)
+
+### Authorization
+
+[apiKey](../README.md#apiKey)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/openapi/GravatarOpenAPIClient/docs/SetEmailAvatarRequest.md b/openapi/GravatarOpenAPIClient/docs/SetEmailAvatarRequest.md
new file mode 100644
index 00000000..a8f4f0ae
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/SetEmailAvatarRequest.md
@@ -0,0 +1,10 @@
+# SetEmailAvatarRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**emailHash** | **String** | The email SHA256 hash to set the avatar for. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/docs/VerifiedAccount.md b/openapi/GravatarOpenAPIClient/docs/VerifiedAccount.md
new file mode 100644
index 00000000..d3fb6545
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/docs/VerifiedAccount.md
@@ -0,0 +1,14 @@
+# VerifiedAccount
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**serviceType** | **String** | The type of the service. |
+**serviceLabel** | **String** | The name of the service. |
+**serviceIcon** | **String** | The URL to the service's icon. |
+**url** | **String** | The URL to the user's profile on the service. |
+**isHidden** | **Bool** | Whether the verified account is hidden from the user's profile. |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/openapi/GravatarOpenAPIClient/project.yml b/openapi/GravatarOpenAPIClient/project.yml
new file mode 100644
index 00000000..3a9d171c
--- /dev/null
+++ b/openapi/GravatarOpenAPIClient/project.yml
@@ -0,0 +1,15 @@
+name: GravatarOpenAPIClient
+targets:
+ GravatarOpenAPIClient:
+ type: framework
+ platform: iOS
+ deploymentTarget: "11.0"
+ sources: [Sources]
+ info:
+ path: ./Info.plist
+ version: 3.0.0
+ settings:
+ APPLICATION_EXTENSION_API_ONLY: true
+ scheme: {}
+ dependencies:
+ - carthage: AnyCodable
diff --git a/openapi/spec.yaml b/openapi/openapi.yaml
similarity index 100%
rename from openapi/spec.yaml
rename to openapi/openapi.yaml
diff --git a/openapi/templates/Podspec.mustache b/openapi/templates/Podspec.mustache
new file mode 100644
index 00000000..6db4fbb6
--- /dev/null
+++ b/openapi/templates/Podspec.mustache
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require_relative 'version'
+
+Pod::Spec.new do |s|
+ s.name = '{{projectName}}'
+ s.summary = 'A Gravatar OpenAPI Client'
+ s.version = Gravatar::VERSION
+
+ s.swift_versions = Gravatar::SWIFT_VERSIONS
+
+ # Match the deployment target of Gravatar in order to satisfy `pod lib lint`
+ s.ios.deployment_target = Gravatar::IOS_DEPLOYMENT_TARGET
+
+ s.homepage = 'https://gravatar.com'
+ s.license = { type: 'Mozilla Public License v2', file: 'LICENSE.md' }
+ s.authors = 'Automattic, Inc.'
+ s.source = { :git => 'https://github.com/Automattic/Gravatar-SDK-iOS.git', :tag => s.version.to_s }
+
+ s.documentation_url = 'https://automattic.github.io/Gravatar-SDK-iOS/gravatar'
+
+ s.source_files = '{{swiftPackagePath}}{{^swiftPackagePath}}{{#packageRootPath}}{{.}}/{{/packageRootPath}}{{#useSPMFileStructure}}Sources/{{projectName}}{{/useSPMFileStructure}}{{^useSPMFileStructure}}{{projectName}}/Classes{{/useSPMFileStructure}}{{/swiftPackagePath}}/**/*.swift'
+end
diff --git a/openapi/model.mustache b/openapi/templates/model.mustache
similarity index 100%
rename from openapi/model.mustache
rename to openapi/templates/model.mustache
diff --git a/openapi/modelInlineEnumDeclaration.mustache b/openapi/templates/modelInlineEnumDeclaration.mustache
similarity index 100%
rename from openapi/modelInlineEnumDeclaration.mustache
rename to openapi/templates/modelInlineEnumDeclaration.mustache
diff --git a/openapi/modelObject.mustache b/openapi/templates/modelObject.mustache
similarity index 100%
rename from openapi/modelObject.mustache
rename to openapi/templates/modelObject.mustache
diff --git a/version.rb b/version.rb
index 9f1943bb..c7fb3356 100644
--- a/version.rb
+++ b/version.rb
@@ -5,4 +5,5 @@ module Gravatar
SWIFT_VERSIONS = [
'5.10'
].freeze
+ IOS_DEPLOYMENT_TARGET = '15.0'
end