Skip to content

Commit d18aece

Browse files
updated
1 parent 3dbf5be commit d18aece

10 files changed

Lines changed: 0 additions & 606 deletions

Sources/Appwrite/Services/Account.swift

Lines changed: 0 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,244 +1339,6 @@ open class Account: Service {
13391339
)
13401340
}
13411341

1342-
///
1343-
/// List payment methods for this account.
1344-
///
1345-
/// - Parameters:
1346-
/// - queries: [String] (optional)
1347-
/// - Throws: Exception if the request fails
1348-
/// - Returns: AppwriteModels.PaymentMethodList
1349-
///
1350-
open func listPaymentMethods(
1351-
queries: [String]? = nil
1352-
) async throws -> AppwriteModels.PaymentMethodList {
1353-
let apiPath: String = "/account/payment-methods"
1354-
1355-
let apiParams: [String: Any?] = [
1356-
"queries": queries
1357-
]
1358-
1359-
let apiHeaders: [String: String] = [:]
1360-
1361-
let converter: (Any) -> AppwriteModels.PaymentMethodList = { response in
1362-
return AppwriteModels.PaymentMethodList.from(map: response as! [String: Any])
1363-
}
1364-
1365-
return try await client.call(
1366-
method: "GET",
1367-
path: apiPath,
1368-
headers: apiHeaders,
1369-
params: apiParams,
1370-
converter: converter
1371-
)
1372-
}
1373-
1374-
///
1375-
/// Create a new payment method for the current user account.
1376-
///
1377-
/// - Throws: Exception if the request fails
1378-
/// - Returns: AppwriteModels.PaymentMethod
1379-
///
1380-
open func createPaymentMethod(
1381-
) async throws -> AppwriteModels.PaymentMethod {
1382-
let apiPath: String = "/account/payment-methods"
1383-
1384-
let apiParams: [String: Any] = [:]
1385-
1386-
let apiHeaders: [String: String] = [
1387-
"content-type": "application/json"
1388-
]
1389-
1390-
let converter: (Any) -> AppwriteModels.PaymentMethod = { response in
1391-
return AppwriteModels.PaymentMethod.from(map: response as! [String: Any])
1392-
}
1393-
1394-
return try await client.call(
1395-
method: "POST",
1396-
path: apiPath,
1397-
headers: apiHeaders,
1398-
params: apiParams,
1399-
converter: converter
1400-
)
1401-
}
1402-
1403-
///
1404-
/// Get a specific payment method for the user.
1405-
///
1406-
/// - Parameters:
1407-
/// - paymentMethodId: String
1408-
/// - Throws: Exception if the request fails
1409-
/// - Returns: AppwriteModels.PaymentMethod
1410-
///
1411-
open func getPaymentMethod(
1412-
paymentMethodId: String
1413-
) async throws -> AppwriteModels.PaymentMethod {
1414-
let apiPath: String = "/account/payment-methods/{paymentMethodId}"
1415-
.replacingOccurrences(of: "{paymentMethodId}", with: paymentMethodId)
1416-
1417-
let apiParams: [String: Any] = [:]
1418-
1419-
let apiHeaders: [String: String] = [:]
1420-
1421-
let converter: (Any) -> AppwriteModels.PaymentMethod = { response in
1422-
return AppwriteModels.PaymentMethod.from(map: response as! [String: Any])
1423-
}
1424-
1425-
return try await client.call(
1426-
method: "GET",
1427-
path: apiPath,
1428-
headers: apiHeaders,
1429-
params: apiParams,
1430-
converter: converter
1431-
)
1432-
}
1433-
1434-
///
1435-
/// Update a new payment method for the current user account.
1436-
///
1437-
/// - Parameters:
1438-
/// - paymentMethodId: String
1439-
/// - expiryMonth: Int
1440-
/// - expiryYear: Int
1441-
/// - state: String (optional)
1442-
/// - Throws: Exception if the request fails
1443-
/// - Returns: AppwriteModels.PaymentMethod
1444-
///
1445-
open func updatePaymentMethod(
1446-
paymentMethodId: String,
1447-
expiryMonth: Int,
1448-
expiryYear: Int,
1449-
state: String? = nil
1450-
) async throws -> AppwriteModels.PaymentMethod {
1451-
let apiPath: String = "/account/payment-methods/{paymentMethodId}"
1452-
.replacingOccurrences(of: "{paymentMethodId}", with: paymentMethodId)
1453-
1454-
let apiParams: [String: Any?] = [
1455-
"expiryMonth": expiryMonth,
1456-
"expiryYear": expiryYear,
1457-
"state": state
1458-
]
1459-
1460-
let apiHeaders: [String: String] = [
1461-
"content-type": "application/json"
1462-
]
1463-
1464-
let converter: (Any) -> AppwriteModels.PaymentMethod = { response in
1465-
return AppwriteModels.PaymentMethod.from(map: response as! [String: Any])
1466-
}
1467-
1468-
return try await client.call(
1469-
method: "PATCH",
1470-
path: apiPath,
1471-
headers: apiHeaders,
1472-
params: apiParams,
1473-
converter: converter
1474-
)
1475-
}
1476-
1477-
///
1478-
/// Delete a specific payment method from a user's account.
1479-
///
1480-
/// - Parameters:
1481-
/// - paymentMethodId: String
1482-
/// - Throws: Exception if the request fails
1483-
/// - Returns: Any
1484-
///
1485-
open func deletePaymentMethod(
1486-
paymentMethodId: String
1487-
) async throws -> Any {
1488-
let apiPath: String = "/account/payment-methods/{paymentMethodId}"
1489-
.replacingOccurrences(of: "{paymentMethodId}", with: paymentMethodId)
1490-
1491-
let apiParams: [String: Any] = [:]
1492-
1493-
let apiHeaders: [String: String] = [
1494-
"content-type": "application/json"
1495-
]
1496-
1497-
return try await client.call(
1498-
method: "DELETE",
1499-
path: apiPath,
1500-
headers: apiHeaders,
1501-
params: apiParams )
1502-
}
1503-
1504-
///
1505-
/// Update payment method provider.
1506-
///
1507-
/// - Parameters:
1508-
/// - paymentMethodId: String
1509-
/// - providerMethodId: String
1510-
/// - name: String
1511-
/// - state: String (optional)
1512-
/// - Throws: Exception if the request fails
1513-
/// - Returns: AppwriteModels.PaymentMethod
1514-
///
1515-
open func updatePaymentMethodProvider(
1516-
paymentMethodId: String,
1517-
providerMethodId: String,
1518-
name: String,
1519-
state: String? = nil
1520-
) async throws -> AppwriteModels.PaymentMethod {
1521-
let apiPath: String = "/account/payment-methods/{paymentMethodId}/provider"
1522-
.replacingOccurrences(of: "{paymentMethodId}", with: paymentMethodId)
1523-
1524-
let apiParams: [String: Any?] = [
1525-
"providerMethodId": providerMethodId,
1526-
"name": name,
1527-
"state": state
1528-
]
1529-
1530-
let apiHeaders: [String: String] = [
1531-
"content-type": "application/json"
1532-
]
1533-
1534-
let converter: (Any) -> AppwriteModels.PaymentMethod = { response in
1535-
return AppwriteModels.PaymentMethod.from(map: response as! [String: Any])
1536-
}
1537-
1538-
return try await client.call(
1539-
method: "PATCH",
1540-
path: apiPath,
1541-
headers: apiHeaders,
1542-
params: apiParams,
1543-
converter: converter
1544-
)
1545-
}
1546-
1547-
///
1548-
/// Update payment method mandate options.
1549-
///
1550-
/// - Parameters:
1551-
/// - paymentMethodId: String
1552-
/// - Throws: Exception if the request fails
1553-
/// - Returns: AppwriteModels.PaymentMethod
1554-
///
1555-
open func updatePaymentMethodMandateOptions(
1556-
paymentMethodId: String
1557-
) async throws -> AppwriteModels.PaymentMethod {
1558-
let apiPath: String = "/account/payment-methods/{paymentMethodId}/setup"
1559-
.replacingOccurrences(of: "{paymentMethodId}", with: paymentMethodId)
1560-
1561-
let apiParams: [String: Any] = [:]
1562-
1563-
let apiHeaders: [String: String] = [
1564-
"content-type": "application/json"
1565-
]
1566-
1567-
let converter: (Any) -> AppwriteModels.PaymentMethod = { response in
1568-
return AppwriteModels.PaymentMethod.from(map: response as! [String: Any])
1569-
}
1570-
1571-
return try await client.call(
1572-
method: "PATCH",
1573-
path: apiPath,
1574-
headers: apiHeaders,
1575-
params: apiParams,
1576-
converter: converter
1577-
)
1578-
}
1579-
15801342
///
15811343
/// Update the currently logged in user's phone number. After updating the
15821344
/// phone number, the phone verification status will be reset. A confirmation

0 commit comments

Comments
 (0)