diff --git a/src/main/lombok/com/restfb/types/whatsapp/CurrencyAmount.java b/src/main/lombok/com/restfb/types/whatsapp/CurrencyAmount.java new file mode 100644 index 000000000..08901dfb2 --- /dev/null +++ b/src/main/lombok/com/restfb/types/whatsapp/CurrencyAmount.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010-2021 Mark Allen, Norbert Bartels. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.restfb.types.whatsapp; + +import com.restfb.Facebook; + +import lombok.Getter; +import lombok.Setter; + +public class CurrencyAmount { + + /** + * Value of the amount in whole currency units (USD 123.45 = "123.45") + */ + @Getter + @Setter + @Facebook + private String amount; + + /** + * Value of the amount in hundredths, i.e. (USD 123.45 = "12345", JYP 1 = "100") + */ + @Getter + @Setter + @Facebook("amount_in_hundredths") + private String amountInHundredths; + + /** + * Currency in which amount is given + */ + @Getter + @Setter + @Facebook + private String currency; + + /** + * Value of the amount in cents (USD 123.45 = "12345") + */ + @Getter + @Setter + @Facebook("offsetted_amount") + private String offsettedAmount; +} diff --git a/src/main/lombok/com/restfb/types/whatsapp/ExtendedCredit.java b/src/main/lombok/com/restfb/types/whatsapp/ExtendedCredit.java new file mode 100644 index 000000000..6d472cd1c --- /dev/null +++ b/src/main/lombok/com/restfb/types/whatsapp/ExtendedCredit.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010-2021 Mark Allen, Norbert Bartels. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.restfb.types.whatsapp; + +import com.restfb.Facebook; +import com.restfb.types.FacebookType; +import com.restfb.types.ads.Business; + +import lombok.Getter; +import lombok.Setter; + +public class ExtendedCredit extends FacebookType { + + /** + * The total amount of credit that has been granted to other businesses. + * + * Going forward, credentials are measured in USD at the top level, and attachable + * to ad accounts of multiple currencies. + */ + @Getter + @Setter + @Facebook("allocated_amount") + private CurrencyAmount allocatedAmount; + + /** + * The total amount spent. + * + * This is calculated by adding parent ad account and all child ad accounts. + * Going forward, credentials are measured in USD at the top level, and attachable + * to ad accounts of multiple currencies. + */ + @Getter + @Setter + @Facebook + private CurrencyAmount balance; + + /** + * The credit available to this business + */ + @Getter + @Setter + @Facebook("credit_available") + private CurrencyAmount creditAvailable; + + /** + * The type of extended credit used. + * + * The most common are ADS_BUSINESS and ADS_SEQUENTIAL + */ + @Getter + @Setter + @Facebook("credit_type") + private String creditType; + + /** + * Returns true if credit owner removed access for previously shared credit line + */ + @Getter + @Setter + @Facebook("is_access_revoked") + private Boolean isAccessRevoked; + + /** + * Whether this credential is using the fully automated experience + */ + @Getter + @Setter + @Facebook("is_automated_experience") + private Boolean isAutomatedExperience; + + /** + * The legal entity name of the owner of a line + */ + @Getter + @Setter + @Facebook("legal_entity_name") + private String legalEntityName; + + /** + * When this credit is chosen as the payment method, + * the business name of the liable_party + */ + @Getter + @Setter + @Facebook("liable_biz_name") + private String liableBizName; + + /** + * The amount of credit available to a specific business. + * + * Going forward, credentials are measured in USD at the top level, and + * attachable to ad accounts of multiple currencies. + */ + @Getter + @Setter + @Facebook("max_balance") + private CurrencyAmount maxBalance; + + /** + * The raw credit limit for an entire business. + * + * Going forward, credentials are measured in USD at the top level, and + * attachable to ad accounts of multiple currencies. + */ + @Getter + @Setter + @Facebook("online_max_balance") + private CurrencyAmount onlineMaxBalance; + + /** + * The business account responsible for extended credit payment + */ + @Getter + @Setter + @Facebook("owner_business") + private Business ownerBusiness; + + /** + * The name of the business account responsible for extended credit payment + */ + @Getter + @Setter + @Facebook("owner_business_name") + private String ownerBusinessName; + + /** + * The name of the business that granted the credit line. For ADS_SEQUENTIAL credit types + */ + @Getter + @Setter + @Facebook("partition_from") + private String partitionFrom; + + /** + * When this credit is chosen as the payment method, the business name of the bill_to_party + */ + @Getter + @Setter + @Facebook("send_bill_to_biz_name") + private String sendBillToBizNname; +} diff --git a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccount.java b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccount.java index 9f57643b3..5e05d1b37 100644 --- a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccount.java +++ b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccount.java @@ -36,6 +36,14 @@ public class WhatsAppBusinessAccount extends NamedFacebookType { private static final long serialVersionUID = 1L; + /** + * Status from account review process + */ + @Getter + @Setter + @Facebook("account_review_status") + private String accountReviewStatus; + /** * Analytics data of the WhatsApp Business Account */ @@ -69,12 +77,28 @@ public class WhatsAppBusinessAccount extends NamedFacebookType { @Facebook("ineligible_for_sending_notifications_reason") private String ineligibleForSendingNotificationsReason; + /** + * Namespace string for the message templates that belong to the WhatsApp Business Account + */ + @Getter + @Setter + @Facebook("message_template_namespace") + private String messageTemplateNamespace; + // WABAOnBehalfOfComputedInfo is not defined in Graph API reference // @Getter // @Setter // @Facebook("WABAOnBehalfOfComputedInfo") // private WABAOnBehalfOfComputedInfo onBehalfOfBusinessInfo; + /** + * Primary funding ID for the WhatsApp Business Account paid service + */ + @Getter + @Setter + @Facebook("primary_funding_id") + private String primaryFundingId; + /** * The purchase order number supplied by the business for payment management purposes */ diff --git a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccountToNumberCurrentStatus.java b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccountToNumberCurrentStatus.java index 7d06e6def..2e6b19b52 100644 --- a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccountToNumberCurrentStatus.java +++ b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppBusinessAccountToNumberCurrentStatus.java @@ -36,11 +36,23 @@ public class WhatsAppBusinessAccountToNumberCurrentStatus extends FacebookType { private static final long serialVersionUID = 1L; + @Getter + @Setter + @Facebook("account_mode") + private String accountMode; + + @Getter + @Setter + @Facebook + private String certificate; + + @Deprecated @Getter @Setter @Facebook("country_code") private String countryCode; + @Deprecated @Getter @Setter @Facebook("country_dial_code") @@ -51,6 +63,27 @@ public class WhatsAppBusinessAccountToNumberCurrentStatus extends FacebookType { @Facebook("display_phone_number") private String displayPhoneNumber; + @Getter + @Setter + @Facebook("name_status") + private String nameStatus; + + @Getter + @Setter + @Facebook("new_certificate") + private String newCertificate; + + @Getter + @Setter + @Facebook("new_name_status") + private String newNameStatus; + + @Getter + @Setter + @Facebook("quality_score") + private WhatsAppPhoneQualityScoreShape qualityScore; + + @Deprecated @Getter @Setter @Facebook("quality_rating") @@ -61,6 +94,7 @@ public class WhatsAppBusinessAccountToNumberCurrentStatus extends FacebookType { @Facebook private String status; + @Deprecated @Getter @Setter @Facebook("verified_name") diff --git a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppHSMQualityScoreShape.java b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppHSMQualityScoreShape.java new file mode 100644 index 000000000..77f56a982 --- /dev/null +++ b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppHSMQualityScoreShape.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010-2021 Mark Allen, Norbert Bartels. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.restfb.types.whatsapp; + +import com.restfb.Facebook; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class WhatsAppHSMQualityScoreShape { + + @Facebook + private List reasons = new ArrayList<>(); + + @Getter + @Setter + @Facebook + private String score; + + /** + * List of reasons for the score of the HSM + */ + public List getReasons() { + return Collections.unmodifiableList(reasons); + } + + public boolean addReason(String reason) { + return reasons.add(reason); + } + + public boolean removeReason(String reason) { + return reasons.remove(reason); + } + +} diff --git a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppMessageTemplate.java b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppMessageTemplate.java index 433dcf9a9..5d8d8927b 100644 --- a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppMessageTemplate.java +++ b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppMessageTemplate.java @@ -100,4 +100,10 @@ public class WhatsAppMessageTemplate extends NamedFacebookType { @Setter @Facebook("name_or_content") private String nameOrContent; + + + @Getter + @Setter + @Facebook("quality_score") + private WhatsAppHSMQualityScoreShape qualityScore; } diff --git a/src/main/lombok/com/restfb/types/whatsapp/WhatsAppPhoneQualityScoreShape.java b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppPhoneQualityScoreShape.java new file mode 100644 index 000000000..124769f77 --- /dev/null +++ b/src/main/lombok/com/restfb/types/whatsapp/WhatsAppPhoneQualityScoreShape.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2021 Mark Allen, Norbert Bartels. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.restfb.types.whatsapp; + +import com.restfb.Facebook; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class WhatsAppPhoneQualityScoreShape { + + /** + * Timestamp of when the score was calculated + */ + @Getter + @Setter + @Facebook + private Integer date; + + @Facebook + private List reasons = new ArrayList<>(); + + /** + * Quality score of the phone + */ + @Getter + @Setter + @Facebook + private String score; + + /** + * Reasons for the quality score + */ + public List getReasons() { + return Collections.unmodifiableList(reasons); + } + + public boolean addReason(String reason) { + return reasons.add(reason); + } + + public boolean removeReason(String reason) { + return reasons.remove(reason); + } +}