Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1157 - whatsapp objects improved
- Loading branch information
Showing
7 changed files
with
410 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
src/main/lombok/com/restfb/types/whatsapp/CurrencyAmount.java
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,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 | ||
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 | ||
private String currency; | ||
|
||
/** | ||
* Value of the amount in cents (USD 123.45 = "12345") | ||
*/ | ||
@Getter | ||
@Setter | ||
@Facebook("offsetted_amount") | ||
private String offsettedAmount; | ||
} |
160 changes: 160 additions & 0 deletions
160
src/main/lombok/com/restfb/types/whatsapp/ExtendedCredit.java
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,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 | ||
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; | ||
} |
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
57 changes: 57 additions & 0 deletions
57
src/main/lombok/com/restfb/types/whatsapp/WhatsAppHSMQualityScoreShape.java
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,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 { | ||
|
||
private List<String> reasons = new ArrayList<>(); | ||
|
||
@Getter | ||
@Setter | ||
private String score; | ||
|
||
/** | ||
* List of reasons for the score of the HSM | ||
*/ | ||
public List<String> getReasons() { | ||
return Collections.unmodifiableList(reasons); | ||
} | ||
|
||
public boolean addReason(String reason) { | ||
return reasons.add(reason); | ||
} | ||
|
||
public boolean removeReason(String reason) { | ||
return reasons.remove(reason); | ||
} | ||
|
||
} |
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.