├── .circleci └── config.yml ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml └── workflows │ ├── ci.yml │ ├── codeql-analysis.yml │ ├── release.yml │ ├── snapshot.yml │ └── sync.yml ├── .gitignore ├── .idea ├── .gitignore ├── .name ├── codeStyleSettings.xml ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── copyright │ ├── apache.xml │ └── profiles_settings.xml ├── encodings.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── .swagger-codegen-ignore ├── .swagger-codegen ├── KB_VERSION ├── VERSION └── kbswagger.yaml ├── LICENSE ├── NEWS ├── README.md ├── pom.xml ├── release.sh ├── spotbugs-exclude.xml └── src ├── main └── java │ └── org │ └── killbill │ └── billing │ └── client │ ├── BillingException.java │ ├── Converter.java │ ├── JaxrsResource.java │ ├── KillBillClientException.java │ ├── KillBillHttpClient.java │ ├── RequestOptions.java │ ├── SslUtils.java │ ├── UTF8UrlEncoder.java │ ├── api │ └── gen │ │ ├── AccountApi.java │ │ ├── AdminApi.java │ │ ├── BundleApi.java │ │ ├── CatalogApi.java │ │ ├── CreditApi.java │ │ ├── CustomFieldApi.java │ │ ├── ExportApi.java │ │ ├── InvoiceApi.java │ │ ├── InvoiceItemApi.java │ │ ├── InvoicePaymentApi.java │ │ ├── NodesInfoApi.java │ │ ├── OverdueApi.java │ │ ├── PaymentApi.java │ │ ├── PaymentGatewayApi.java │ │ ├── PaymentMethodApi.java │ │ ├── PaymentTransactionApi.java │ │ ├── PluginInfoApi.java │ │ ├── SecurityApi.java │ │ ├── SubscriptionApi.java │ │ ├── TagApi.java │ │ ├── TagDefinitionApi.java │ │ ├── TenantApi.java │ │ └── UsageApi.java │ ├── model │ ├── AccountEmails.java │ ├── Accounts.java │ ├── AuditLogs.java │ ├── BlockingStates.java │ ├── BulkSubscriptionsBundles.java │ ├── Bundles.java │ ├── CatalogVersions.java │ ├── Catalogs.java │ ├── CustomFields.java │ ├── DateTimes.java │ ├── InvoiceItems.java │ ├── InvoicePayments.java │ ├── Invoices.java │ ├── KillBillObject.java │ ├── KillBillObjects.java │ ├── NodeInfos.java │ ├── PaymentMethods.java │ ├── Payments.java │ ├── PlanDetails.java │ ├── PluginInfos.java │ ├── Strings.java │ ├── Subscriptions.java │ ├── TagDefinitions.java │ ├── Tags.java │ ├── TenantKeyValues.java │ └── gen │ │ ├── Account.java │ │ ├── AccountEmail.java │ │ ├── AccountTimeline.java │ │ ├── AdminPayment.java │ │ ├── AuditLog.java │ │ ├── BlockPrice.java │ │ ├── BlockingState.java │ │ ├── BulkSubscriptionsBundle.java │ │ ├── Bundle.java │ │ ├── BundleTimeline.java │ │ ├── Catalog.java │ │ ├── CatalogValidation.java │ │ ├── CatalogValidationError.java │ │ ├── ComboHostedPaymentPage.java │ │ ├── ComboPaymentTransaction.java │ │ ├── CustomField.java │ │ ├── Duration.java │ │ ├── EventSubscription.java │ │ ├── HostedPaymentPageFields.java │ │ ├── HostedPaymentPageFormDescriptor.java │ │ ├── Invoice.java │ │ ├── InvoiceDryRun.java │ │ ├── InvoiceItem.java │ │ ├── InvoicePayment.java │ │ ├── InvoicePaymentTransaction.java │ │ ├── Limit.java │ │ ├── NodeCommand.java │ │ ├── NodeCommandProperty.java │ │ ├── NodeInfo.java │ │ ├── Overdue.java │ │ ├── OverdueCondition.java │ │ ├── OverdueState.java │ │ ├── OverdueStateConfig.java │ │ ├── Payment.java │ │ ├── PaymentAttempt.java │ │ ├── PaymentMethod.java │ │ ├── PaymentMethodPluginDetail.java │ │ ├── PaymentTransaction.java │ │ ├── Phase.java │ │ ├── PhasePrice.java │ │ ├── Plan.java │ │ ├── PlanDetail.java │ │ ├── PluginInfo.java │ │ ├── PluginProperty.java │ │ ├── PluginServiceInfo.java │ │ ├── Price.java │ │ ├── PriceList.java │ │ ├── Product.java │ │ ├── RoleDefinition.java │ │ ├── RolledUpUnit.java │ │ ├── RolledUpUsage.java │ │ ├── Session.java │ │ ├── SimplePlan.java │ │ ├── Subject.java │ │ ├── Subscription.java │ │ ├── SubscriptionUsageRecord.java │ │ ├── Tag.java │ │ ├── TagDefinition.java │ │ ├── Tenant.java │ │ ├── TenantKeyValue.java │ │ ├── Tier.java │ │ ├── TierPrice.java │ │ ├── TieredBlock.java │ │ ├── Unit.java │ │ ├── UnitUsageRecord.java │ │ ├── Usage.java │ │ ├── UsagePrice.java │ │ ├── UsageRecord.java │ │ └── UserRoles.java │ └── util │ ├── Multimap.java │ ├── Preconditions.java │ └── TreeMapSetMultimap.java └── test ├── java └── org │ └── killbill │ └── billing │ └── client │ ├── TestRequestOptions.java │ ├── api │ └── gen │ │ └── TestInvoiceApi.java │ └── util │ └── TestTreeMapSetMultimap.java └── resources └── catalog.xml /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | defaults: &defaults 2 | working_directory: ~/repo 3 | environment: 4 | MAVEN_OPTS: -server -showversion -XX:+PrintCommandLineFlags -XX:+UseCodeCacheFlushing -Xms1024M -Xmx2048M -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -XX:NewSize=600m -XX:MaxNewSize=900m -XX:SurvivorRatio=10 -XX:+DisableExplicitGC -Djava.security.egd=file:/dev/./urandom 5 | 6 | version: 2 7 | jobs: 8 | build: 9 | <<: *defaults 10 | docker: 11 | - image: killbill/kbbuild:0.7.0 12 | steps: 13 | - checkout 14 | - run: 15 | name: Setup dependencies 16 | command: | 17 | if [ "${CIRCLE_BRANCH}" != "master" ]; then 18 | for i in killbill-oss-parent killbill-api; do 19 | if [ -n "$(git ls-remote --heads https://github.com/killbill/$i.git ${CIRCLE_BRANCH})" ]; then 20 | echo "*** Setting up $i" 21 | mkdir -p /home/killbill/$i 22 | git clone https://github.com/killbill/$i.git /home/killbill/$i 23 | pushd /home/killbill/$i 24 | git checkout -b ${CIRCLE_BRANCH} origin/${CIRCLE_BRANCH} 25 | mvn clean install -DskipTests=true 26 | popd 27 | fi 28 | done 29 | fi 30 | - run: mvn -DskipTests=true clean install 31 | - save_cache: 32 | paths: 33 | - ~/.m2 34 | key: v1-dependencies-{{ .Revision }} 35 | 36 | test-h2: 37 | <<: *defaults 38 | docker: 39 | - image: killbill/kbbuild:0.7.0 40 | steps: 41 | - checkout 42 | - restore_cache: 43 | key: v1-dependencies-{{ .Revision }} 44 | - run: mvn clean install -Ptravis 45 | - run: 46 | name: Save test results 47 | command: | 48 | mkdir -p ~/junit/ 49 | find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/junit/ \; 50 | when: always 51 | - store_test_results: 52 | path: ~/junit 53 | - store_artifacts: 54 | path: ~/junit 55 | 56 | workflows: 57 | version: 2 58 | build-and-test: 59 | jobs: 60 | - build 61 | - test-h2: 62 | requires: 63 | - build 64 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to Kill Bill 2 | 3 | **Do not open up a GitHub issue before reaching out to our [Mailing-List](https://groups.google.com/forum/#!forum/killbilling-users)**. GitHub issues are primarily intended for tracking bug reports and fixes by the core team. 4 | 5 | #### **Did you find a bug?** 6 | 7 | In your [Mailing-List](https://groups.google.com/forum/#!forum/killbilling-users) post, specify: 8 | 9 | * Step by step description on how to reproduce the issue 10 | * [Account data and system dump](http://docs.killbill.io/latest/debugging.html#_seeking_help) via KPM of an affected account 11 | 12 | #### **Do you intend to add a new feature or change an existing one?** 13 | 14 | Do not open an issue or pull request on GitHub until you have collected positive feedback about the change on the [Mailing-List](https://groups.google.com/forum/#!forum/killbilling-users). 15 | 16 | When submitting code, make sure to add [new tests](http://docs.killbill.io/latest/development.html#_navigating_the_kill_bill_codebase). 17 | 18 | #### **Do you want to contribute to the Kill Bill documentation?** 19 | 20 | Open a pull request on GitHub in the [killbill-docs](https://github.com/killbill/killbill-docs) repository. 21 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [killbill] 4 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | jobs: 9 | ci: 10 | uses: killbill/gh-actions-shared/.github/workflows/ci.yml@main 11 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: CodeQL 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | jobs: 9 | analyze: 10 | uses: killbill/gh-actions-shared/.github/workflows/codeql-analysis.yml@main 11 | -------------------------------------------------------------------------------- /.github/workflows/snapshot.yml: -------------------------------------------------------------------------------- 1 | name: snapshot 2 | 3 | on: 4 | push: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | snapshot: 9 | uses: killbill/gh-actions-shared/.github/workflows/snapshot.yml@main 10 | secrets: 11 | OSSRH_USER: ${{ secrets.OSSRH_USER }} 12 | OSSRH_PASS: ${{ secrets.OSSRH_PASS }} 13 | -------------------------------------------------------------------------------- /.github/workflows/sync.yml: -------------------------------------------------------------------------------- 1 | name: sync 2 | 3 | on: 4 | #schedule: 5 | # - cron: '0 0 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | sync: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | with: 14 | fetch-depth: 0 15 | ref: work-for-release-0.23.x 16 | ssh-key: ${{ secrets.CREATE_PULL_REQUEST_SSH_KEY }} 17 | - name: Setup git user 18 | env: 19 | BUILD_USER: ${{ secrets.BUILD_USER }} 20 | BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} 21 | run: | 22 | git config --global user.email "contact@killbill.io" 23 | git config --global user.name "Kill Bill core team" 24 | git config --global url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "git@github.com:" 25 | - name: Merge master branch 26 | run: | 27 | git merge origin/master 28 | - name: Create Pull Request 29 | uses: peter-evans/create-pull-request@v3 30 | with: 31 | branch: work-for-release-0.23.x-promotion 32 | title: 'Sync master into work-for-release-0.23.x' 33 | body: 'Merge latest master into work-for-release-0.23.x' 34 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | killbill-client-java -------------------------------------------------------------------------------- /.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 59 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 28 | 29 | 30 | 33 | 34 | 56 | 57 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/copyright/apache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 53 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.swagger-codegen-ignore: -------------------------------------------------------------------------------- 1 | # Swagger Codegen Ignore 2 | # Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.swagger-codegen/KB_VERSION: -------------------------------------------------------------------------------- 1 | swaggerVersion=2.4.1 2 | kbVersion=0.23.0-SNAPSHOT 3 | kbApiVersion=0.54.0-ded8ade-SNAPSHOT 4 | kbPluginApiVersion=0.27.0-df83159-SNAPSHOT 5 | -------------------------------------------------------------------------------- /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 2.4.1 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # killbill-client-java 2 | ![Maven Central](https://img.shields.io/maven-central/v/org.kill-bill.billing/killbill-client-java?color=blue&label=Maven%20Central) 3 | 4 | Java client library for Kill Bill. 5 | 6 | ## Kill Bill compatibility 7 | 8 | | Client version | Kill Bill version | 9 | | -------------: | ----------------: | 10 | | 0.23.y | 0.16.z | 11 | | 0.40.y | 0.18.z | 12 | | 0.41.y | 0.19.z | 13 | | 1.0.y | 0.20.z | 14 | | 1.1.y | 0.22.z | 15 | | 1.2.y | 0.22.z | 16 | | 1.3.y | 0.24.z | 17 | 18 | We've upgraded numerous dependencies in 1.2.x (required for Java 11 support). 19 | 20 | ## Usage 21 | 22 | Add the library to your application: 23 | 24 | ```xml 25 | 26 | org.kill-bill.billing 27 | killbill-client-java 28 | ... release version ... 29 | 30 | ``` 31 | 32 | The easiest way to get started is to look at our [Java client tutorial](https://docs.killbill.io/latest/java_client.html). We also provide a sample [Java client application](https://github.com/killbill/killbill-client-java-example). You can clone this project in order to get started. 33 | 34 | When sending a body, if you are unsure which parameters to pass, take a look at the [Java api documentation](https://killbill.github.io/slate/?java#). 35 | 36 | ## Build 37 | 38 | To build the library: 39 | 40 | ``` 41 | mvn clean install -DskipTests=true 42 | ``` 43 | 44 | This will produce several jars, including: 45 | 46 | * killbill-client-java-x.y.z-SNAPSHOT.jar which contains the library only 47 | * killbill-client-java-x.y.z-SNAPSHOT-jar-with-dependencies.jar which is a self-contained jar (library and dependencies) 48 | 49 | ## About 50 | 51 | Kill Bill is the leading Open-Source Subscription Billing & Payments Platform. For more information about the project, go to https://killbill.io/. 52 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | ################################################################################### 2 | # # 3 | # Copyright 2010-2014 Ning, Inc. # 4 | # # 5 | # Ning licenses this file to you under the Apache License, version 2.0 # 6 | # (the "License"); you may not use this file except in compliance with the # 7 | # License. You may obtain a copy of the License at: # 8 | # # 9 | # http://www.apache.org/licenses/LICENSE-2.0 # 10 | # # 11 | # Unless required by applicable law or agreed to in writing, software # 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 14 | # License for the specific language governing permissions and limitations # 15 | # under the License. # 16 | # # 17 | ################################################################################### 18 | # Prepare a release: 19 | # * Update the NEWS file 20 | # * Commit all pending changes 21 | # * Do the release 22 | set -e 23 | 24 | # Make sure we're up-to-date 25 | git pull 26 | 27 | LAST_NEWS_VERSION=$(head -1 NEWS) 28 | NEXT_VERSION=`grep -E '([0-9]+\.[0-9]+\.[0-9]+)-SNAPSHOT' pom.xml | sed 's/[\t \n]*\(.*\)-SNAPSHOT<\/version>[\t \n]*/\1/'` 29 | 30 | echo "Enter the NEWS changelog for version $NEXT_VERSION and hit ctrl-d when done (ctrl-c to abort)" 31 | original_news_message=$(cat) 32 | 33 | # Indent it 34 | news_message=$(echo "$original_news_message" | sed 's/^/ /g') 35 | 36 | if [ "$LAST_NEWS_VERSION" = "$NEXT_VERSION" ]; then 37 | previous_news=$(cat NEWS | sed '1d') 38 | echo -e "$NEXT_VERSION\n$news_message\n$previous_news" > NEWS 39 | else 40 | previous_news=$(cat NEWS) 41 | echo -e "$NEXT_VERSION\n$news_message\n\n$previous_news" > NEWS 42 | fi 43 | 44 | # Add to git 45 | git add -p 46 | git commit -s -m "pom.xml: updates for release $NEXT_VERSION 47 | 48 | $original_news_message" 49 | 50 | # Make sure we can push before the release 51 | git push 52 | 53 | # Do the release 54 | echo "Running: mvn release:clean" && \ 55 | mvn release:clean && \ 56 | echo "Running: mvn release:prepare" && \ 57 | mvn release:prepare && \ 58 | echo "Running: mvn release:perform" && \ 59 | mvn release:perform 60 | -------------------------------------------------------------------------------- /spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/BillingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client; 21 | 22 | import java.util.List; 23 | 24 | import javax.annotation.Nullable; 25 | 26 | import com.fasterxml.jackson.annotation.JsonCreator; 27 | import com.fasterxml.jackson.annotation.JsonProperty; 28 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 29 | 30 | public class BillingException { 31 | 32 | private String className; 33 | private Integer code; 34 | private String message; 35 | private String causeClassName; 36 | private String causeMessage; 37 | private List stackTrace; 38 | // TODO add getSuppressed() from 1.7? 39 | 40 | @SuppressFBWarnings("NM_CLASS_NOT_EXCEPTION") 41 | @JsonCreator 42 | public BillingException(@JsonProperty("className") final String className, 43 | @JsonProperty("code") @Nullable final Integer code, 44 | @JsonProperty("message") final String message, 45 | @JsonProperty("causeClassName") final String causeClassName, 46 | @JsonProperty("causeMessage") final String causeMessage, 47 | @JsonProperty("stackTrace") final List stackTrace) { 48 | this.className = className; 49 | this.code = code; 50 | this.message = message; 51 | this.causeClassName = causeClassName; 52 | this.causeMessage = causeMessage; 53 | this.stackTrace = stackTrace; 54 | } 55 | 56 | public String getClassName() { 57 | return className; 58 | } 59 | 60 | public void setClassName(final String className) { 61 | this.className = className; 62 | } 63 | 64 | public Integer getCode() { 65 | return code; 66 | } 67 | 68 | public void setCode(final Integer code) { 69 | this.code = code; 70 | } 71 | 72 | public String getMessage() { 73 | return message; 74 | } 75 | 76 | public void setMessage(final String message) { 77 | this.message = message; 78 | } 79 | 80 | public String getCauseClassName() { 81 | return causeClassName; 82 | } 83 | 84 | public void setCauseClassName(final String causeClassName) { 85 | this.causeClassName = causeClassName; 86 | } 87 | 88 | public String getCauseMessage() { 89 | return causeMessage; 90 | } 91 | 92 | public void setCauseMessage(final String causeMessage) { 93 | this.causeMessage = causeMessage; 94 | } 95 | 96 | public List getStackTrace() { 97 | return stackTrace; 98 | } 99 | 100 | public void setStackTrace(final List stackTrace) { 101 | this.stackTrace = stackTrace; 102 | } 103 | 104 | @Override 105 | public String toString() { 106 | final StringBuilder sb = new StringBuilder("BillingException{"); 107 | sb.append("className='").append(className).append('\''); 108 | sb.append(", code=").append(code); 109 | sb.append(", message='").append(message).append('\''); 110 | sb.append(", causeClassName='").append(causeClassName).append('\''); 111 | sb.append(", causeMessage='").append(causeMessage).append('\''); 112 | sb.append(", stackTrace=").append(stackTrace); 113 | sb.append('}'); 114 | return sb.toString(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client; 21 | 22 | import java.util.ArrayList; 23 | import java.util.Collections; 24 | import java.util.List; 25 | import java.util.Map; 26 | import java.util.Map.Entry; 27 | import java.util.UUID; 28 | import java.util.stream.Collectors; 29 | 30 | public class Converter { 31 | 32 | public static List convertEnumListToStringList(final List> in) { 33 | return in.stream() 34 | .map(input -> input == null ? null : input.name()) 35 | .collect(Collectors.toUnmodifiableList()); 36 | } 37 | 38 | public static List convertUUIDListToStringList(final List in) { 39 | return in.stream() 40 | .map(input -> input == null ? null : input.toString()) 41 | .collect(Collectors.toUnmodifiableList()); 42 | } 43 | 44 | public static List convertPluginPropertyMap(final Map pluginProperties) { 45 | if (pluginProperties == null || pluginProperties.isEmpty()) { 46 | return Collections.emptyList(); 47 | } 48 | final List result = new ArrayList<>(); 49 | for (final Entry entry : pluginProperties.entrySet()) { 50 | final String encodedKey = UTF8UrlEncoder.encode(entry.getKey()); 51 | final String encodedValue = UTF8UrlEncoder.encode(entry.getValue()); 52 | result.add(String.format("%s=%s", encodedKey, encodedValue)); 53 | } 54 | return result; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/KillBillClientException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2022 Equinix, Inc 5 | * Copyright 2014-2022 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client; 21 | 22 | import java.io.InputStream; 23 | import java.net.http.HttpResponse; 24 | 25 | @SuppressWarnings("serial") 26 | public class KillBillClientException extends Exception { 27 | 28 | private final HttpResponse response; 29 | private final BillingException billingException; 30 | 31 | public KillBillClientException(final Exception cause) { 32 | super(cause); 33 | response = null; 34 | billingException = null; 35 | } 36 | 37 | public KillBillClientException(final HttpResponse response) { 38 | super(); 39 | this.response = response; 40 | this.billingException = null; 41 | } 42 | 43 | public KillBillClientException(final Exception cause, final HttpResponse response) { 44 | super(cause); 45 | this.response = response; 46 | billingException = null; 47 | } 48 | 49 | public KillBillClientException(final BillingException exception, final HttpResponse response) { 50 | super(exception.getMessage()); 51 | this.response = response; 52 | this.billingException = exception; 53 | } 54 | 55 | public HttpResponse getResponse() { 56 | return response; 57 | } 58 | 59 | public BillingException getBillingException() { 60 | return billingException; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/SslUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client; 21 | 22 | import java.security.GeneralSecurityException; 23 | import java.security.KeyManagementException; 24 | import java.security.NoSuchAlgorithmException; 25 | import java.security.SecureRandom; 26 | import java.util.Objects; 27 | 28 | import javax.annotation.Nullable; 29 | import javax.net.ssl.SSLContext; 30 | import javax.net.ssl.TrustManager; 31 | import javax.net.ssl.X509TrustManager; 32 | 33 | public class SslUtils { 34 | 35 | private static final String TLS_PROTOCOL_DEFAULT = "TLSv1.2"; 36 | private final SSLContext looseTrustManagerSSLContext = looseTrustManagerSSLContext(); 37 | private SSLContext context; 38 | 39 | public static SslUtils getInstance() { 40 | return SingletonHolder.instance; 41 | } 42 | 43 | private SSLContext looseTrustManagerSSLContext() { 44 | try { 45 | final SSLContext sslContext = SSLContext.getInstance("TLS"); 46 | sslContext.init(null, new TrustManager[]{new LooseTrustManager()}, new SecureRandom()); 47 | return sslContext; 48 | } catch (final NoSuchAlgorithmException e) { 49 | throw new ExceptionInInitializerError(e); 50 | } catch (final KeyManagementException e) { 51 | throw new ExceptionInInitializerError(e); 52 | } 53 | } 54 | 55 | public SSLContext getSSLContext(final boolean acceptAnyCertificate, @Nullable final String protocol) throws GeneralSecurityException { 56 | if (acceptAnyCertificate) { 57 | return looseTrustManagerSSLContext; 58 | } else if (context == null) { 59 | this.context = SSLContext.getInstance(Objects.requireNonNullElse(protocol, TLS_PROTOCOL_DEFAULT)); 60 | this.context.init(null, null, null); 61 | } 62 | return this.context; 63 | } 64 | 65 | private static class LooseTrustManager implements X509TrustManager { 66 | 67 | public java.security.cert.X509Certificate[] getAcceptedIssuers() { 68 | return new java.security.cert.X509Certificate[0]; 69 | } 70 | 71 | public void checkClientTrusted(final java.security.cert.X509Certificate[] certs, final String authType) { 72 | } 73 | 74 | public void checkServerTrusted(final java.security.cert.X509Certificate[] certs, final String authType) { 75 | } 76 | } 77 | 78 | private static class SingletonHolder { 79 | 80 | static final SslUtils instance = new SslUtils(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/UTF8UrlEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client; 19 | 20 | /** 21 | * Convenience class that encapsulates details of "percent encoding" 22 | * (as per RFC-3986, see [http://www.ietf.org/rfc/rfc3986.txt]). 23 | */ 24 | public final class UTF8UrlEncoder { 25 | 26 | /** 27 | * Encoding table used for figuring out ascii characters that must be escaped 28 | * (all non-Ascii characters need to be encoded anyway) 29 | */ 30 | private static final boolean[] SAFE_ASCII = new boolean[128]; 31 | 32 | static { 33 | for (int i = 'a'; i <= 'z'; ++i) { 34 | SAFE_ASCII[i] = true; 35 | } 36 | for (int i = 'A'; i <= 'Z'; ++i) { 37 | SAFE_ASCII[i] = true; 38 | } 39 | for (int i = '0'; i <= '9'; ++i) { 40 | SAFE_ASCII[i] = true; 41 | } 42 | SAFE_ASCII['-'] = true; 43 | SAFE_ASCII['.'] = true; 44 | SAFE_ASCII['_'] = true; 45 | SAFE_ASCII['~'] = true; 46 | } 47 | 48 | private static final char[] HEX = "0123456789ABCDEF".toCharArray(); 49 | 50 | private UTF8UrlEncoder() { 51 | } 52 | 53 | public static String encode(final CharSequence input) { 54 | return encode(input, false); 55 | } 56 | 57 | public static String encode(final CharSequence input, final boolean encodeSpaceUsingPlus) { 58 | final StringBuilder sb = new StringBuilder(input.length() + 16); 59 | appendEncoded(sb, input, encodeSpaceUsingPlus); 60 | return sb.toString(); 61 | } 62 | 63 | public static StringBuilder appendEncoded(final StringBuilder sb, final CharSequence input) { 64 | return appendEncoded(sb, input, false); 65 | } 66 | 67 | public static StringBuilder appendEncoded(final StringBuilder sb, final CharSequence input, final boolean encodeSpaceUsingPlus) { 68 | int c; 69 | for (int i = 0; i < input.length(); i += Character.charCount(c)) { 70 | c = Character.codePointAt(input, i); 71 | if (c <= 127) { 72 | if (SAFE_ASCII[c]) { 73 | sb.append((char) c); 74 | } else { 75 | appendSingleByteEncoded(sb, c, encodeSpaceUsingPlus); 76 | } 77 | } else { 78 | appendMultiByteEncoded(sb, c, encodeSpaceUsingPlus); 79 | } 80 | } 81 | return sb; 82 | } 83 | 84 | private static void appendSingleByteEncoded(final StringBuilder sb, final int value, final boolean encodeSpaceUsingPlus) { 85 | if (encodeSpaceUsingPlus && value == 32) { 86 | sb.append('+'); 87 | return; 88 | } 89 | 90 | sb.append('%'); 91 | sb.append(HEX[value >> 4]); 92 | sb.append(HEX[value & 0xF]); 93 | } 94 | 95 | private static void appendMultiByteEncoded(final StringBuilder sb, final int value, final boolean encodeSpaceUsingPlus) { 96 | if (value < 0x800) { 97 | appendSingleByteEncoded(sb, (0xc0 | (value >> 6)), encodeSpaceUsingPlus); 98 | appendSingleByteEncoded(sb, (0x80 | (value & 0x3f)), encodeSpaceUsingPlus); 99 | } else if (value < 0x10000) { 100 | appendSingleByteEncoded(sb, (0xe0 | (value >> 12)), encodeSpaceUsingPlus); 101 | appendSingleByteEncoded(sb, (0x80 | ((value >> 6) & 0x3f)), encodeSpaceUsingPlus); 102 | appendSingleByteEncoded(sb, (0x80 | (value & 0x3f)), encodeSpaceUsingPlus); 103 | } else { 104 | appendSingleByteEncoded(sb, (0xf0 | (value >> 18)), encodeSpaceUsingPlus); 105 | appendSingleByteEncoded(sb, (0x80 | (value >> 12) & 0x3f), encodeSpaceUsingPlus); 106 | appendSingleByteEncoded(sb, (0x80 | (value >> 6) & 0x3f), encodeSpaceUsingPlus); 107 | appendSingleByteEncoded(sb, (0x80 | (value & 0x3f)), encodeSpaceUsingPlus); 108 | } 109 | } 110 | } -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/api/gen/CreditApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.api.gen; 22 | 23 | import java.util.Objects; 24 | 25 | import org.killbill.billing.client.model.gen.InvoiceItem; 26 | import java.util.UUID; 27 | import org.killbill.billing.client.model.InvoiceItems; 28 | import java.util.List; 29 | import java.util.Map; 30 | 31 | import org.killbill.billing.client.Converter; 32 | import org.killbill.billing.client.KillBillClientException; 33 | import org.killbill.billing.client.KillBillHttpClient; 34 | import org.killbill.billing.client.RequestOptions; 35 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 36 | 37 | import org.killbill.billing.client.util.Preconditions; 38 | import org.killbill.billing.client.util.Multimap; 39 | import org.killbill.billing.client.util.TreeMapSetMultimap; 40 | 41 | /** 42 | * DO NOT EDIT !!! 43 | * 44 | * This code has been generated by the Kill Bill swagger generator. 45 | * @See https://github.com/killbill/killbill-swagger-coden 46 | */ 47 | public class CreditApi { 48 | 49 | private final KillBillHttpClient httpClient; 50 | 51 | public CreditApi() { 52 | this(new KillBillHttpClient()); 53 | } 54 | 55 | public CreditApi(final KillBillHttpClient httpClient) { 56 | this.httpClient = httpClient; 57 | } 58 | 59 | public InvoiceItems createCredits(final InvoiceItems body, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException { 60 | return createCredits(body, Boolean.valueOf(false), pluginProperty, inputOptions); 61 | } 62 | 63 | public InvoiceItems createCredits(final InvoiceItems body, final Boolean autoCommit, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException { 64 | Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling createCredits"); 65 | 66 | final String uri = "/1.0/kb/credits"; 67 | 68 | final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams()); 69 | if (autoCommit != null) { 70 | queryParams.put("autoCommit", String.valueOf(autoCommit)); 71 | } 72 | if (pluginProperty != null) { 73 | queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty)); 74 | } 75 | 76 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 77 | final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE); 78 | inputOptionsBuilder.withFollowLocation(followLocation); 79 | inputOptionsBuilder.withQueryParams(queryParams.asMap()); 80 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 81 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json"); 82 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 83 | 84 | return httpClient.doPost(uri, body, InvoiceItems.class, requestOptions); 85 | } 86 | 87 | public InvoiceItem getCredit(final UUID creditId, final RequestOptions inputOptions) throws KillBillClientException { 88 | Preconditions.checkNotNull(creditId, "Missing the required parameter 'creditId' when calling getCredit"); 89 | 90 | final String uri = "/1.0/kb/credits/{creditId}" 91 | .replaceAll("\\{" + "creditId" + "\\}", creditId.toString()); 92 | 93 | 94 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 95 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 96 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 97 | 98 | return httpClient.doGet(uri, InvoiceItem.class, requestOptions); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/api/gen/ExportApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.api.gen; 22 | 23 | import java.util.Objects; 24 | 25 | import java.util.UUID; 26 | import java.io.InputStream; 27 | import java.io.OutputStream; 28 | import java.net.http.HttpResponse; 29 | 30 | import org.killbill.billing.client.Converter; 31 | import org.killbill.billing.client.KillBillClientException; 32 | import org.killbill.billing.client.KillBillHttpClient; 33 | import org.killbill.billing.client.RequestOptions; 34 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 35 | 36 | import org.killbill.billing.client.util.Preconditions; 37 | import org.killbill.billing.client.util.Multimap; 38 | import org.killbill.billing.client.util.TreeMapSetMultimap; 39 | 40 | /** 41 | * DO NOT EDIT !!! 42 | * 43 | * This code has been generated by the Kill Bill swagger generator. 44 | * @See https://github.com/killbill/killbill-swagger-coden 45 | */ 46 | public class ExportApi { 47 | 48 | private final KillBillHttpClient httpClient; 49 | 50 | public ExportApi() { 51 | this(new KillBillHttpClient()); 52 | } 53 | 54 | public ExportApi(final KillBillHttpClient httpClient) { 55 | this.httpClient = httpClient; 56 | } 57 | 58 | public int exportDataForAccount(final UUID accountId, final OutputStream outputStream, final RequestOptions inputOptions) throws KillBillClientException { 59 | Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling exportDataForAccount"); 60 | 61 | final String uri = "/1.0/kb/export/{accountId}" 62 | .replaceAll("\\{" + "accountId" + "\\}", accountId.toString()); 63 | 64 | 65 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 66 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/octet-stream"); 67 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 68 | 69 | final HttpResponse response = httpClient.doGet(uri, outputStream, requestOptions); 70 | return response.statusCode(); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/api/gen/NodesInfoApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.api.gen; 22 | 23 | import java.util.Objects; 24 | 25 | import org.killbill.billing.client.model.gen.NodeCommand; 26 | import org.killbill.billing.client.model.gen.NodeInfo; 27 | import org.killbill.billing.client.model.NodeInfos; 28 | import java.util.List; 29 | 30 | import org.killbill.billing.client.Converter; 31 | import org.killbill.billing.client.KillBillClientException; 32 | import org.killbill.billing.client.KillBillHttpClient; 33 | import org.killbill.billing.client.RequestOptions; 34 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 35 | 36 | import org.killbill.billing.client.util.Preconditions; 37 | import org.killbill.billing.client.util.Multimap; 38 | import org.killbill.billing.client.util.TreeMapSetMultimap; 39 | 40 | /** 41 | * DO NOT EDIT !!! 42 | * 43 | * This code has been generated by the Kill Bill swagger generator. 44 | * @See https://github.com/killbill/killbill-swagger-coden 45 | */ 46 | public class NodesInfoApi { 47 | 48 | private final KillBillHttpClient httpClient; 49 | 50 | public NodesInfoApi() { 51 | this(new KillBillHttpClient()); 52 | } 53 | 54 | public NodesInfoApi(final KillBillHttpClient httpClient) { 55 | this.httpClient = httpClient; 56 | } 57 | 58 | public NodeInfos getNodesInfo(final RequestOptions inputOptions) throws KillBillClientException { 59 | 60 | final String uri = "/1.0/kb/nodesInfo"; 61 | 62 | 63 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 64 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 65 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 66 | 67 | return httpClient.doGet(uri, NodeInfos.class, requestOptions); 68 | } 69 | 70 | public void triggerNodeCommand(final NodeCommand body, final RequestOptions inputOptions) throws KillBillClientException { 71 | triggerNodeCommand(body, Boolean.valueOf(false), inputOptions); 72 | } 73 | 74 | public void triggerNodeCommand(final NodeCommand body, final Boolean localNodeOnly, final RequestOptions inputOptions) throws KillBillClientException { 75 | Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling triggerNodeCommand"); 76 | 77 | final String uri = "/1.0/kb/nodesInfo"; 78 | 79 | final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams()); 80 | if (localNodeOnly != null) { 81 | queryParams.put("localNodeOnly", String.valueOf(localNodeOnly)); 82 | } 83 | 84 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 85 | final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE); 86 | inputOptionsBuilder.withFollowLocation(followLocation); 87 | inputOptionsBuilder.withQueryParams(queryParams.asMap()); 88 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 89 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json"); 90 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 91 | 92 | httpClient.doPost(uri, body, requestOptions); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/api/gen/OverdueApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.api.gen; 22 | 23 | import java.util.Objects; 24 | 25 | import org.killbill.billing.client.model.gen.Overdue; 26 | 27 | import org.killbill.billing.client.Converter; 28 | import org.killbill.billing.client.KillBillClientException; 29 | import org.killbill.billing.client.KillBillHttpClient; 30 | import org.killbill.billing.client.RequestOptions; 31 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 32 | 33 | import org.killbill.billing.client.util.Preconditions; 34 | import org.killbill.billing.client.util.Multimap; 35 | import org.killbill.billing.client.util.TreeMapSetMultimap; 36 | 37 | /** 38 | * DO NOT EDIT !!! 39 | * 40 | * This code has been generated by the Kill Bill swagger generator. 41 | * @See https://github.com/killbill/killbill-swagger-coden 42 | */ 43 | public class OverdueApi { 44 | 45 | private final KillBillHttpClient httpClient; 46 | 47 | public OverdueApi() { 48 | this(new KillBillHttpClient()); 49 | } 50 | 51 | public OverdueApi(final KillBillHttpClient httpClient) { 52 | this.httpClient = httpClient; 53 | } 54 | 55 | public Overdue getOverdueConfigJson(final RequestOptions inputOptions) throws KillBillClientException { 56 | 57 | final String uri = "/1.0/kb/overdue"; 58 | 59 | 60 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 61 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 62 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 63 | 64 | return httpClient.doGet(uri, Overdue.class, requestOptions); 65 | } 66 | 67 | public String getOverdueConfigXml(final RequestOptions inputOptions) throws KillBillClientException { 68 | 69 | final String uri = "/1.0/kb/overdue/xml"; 70 | 71 | 72 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 73 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "text/xml"); 74 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 75 | 76 | return httpClient.doGet(uri, String.class, requestOptions); 77 | } 78 | 79 | public Overdue uploadOverdueConfigJson(final Overdue body, final RequestOptions inputOptions) throws KillBillClientException { 80 | Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling uploadOverdueConfigJson"); 81 | 82 | final String uri = "/1.0/kb/overdue"; 83 | 84 | 85 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 86 | final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE); 87 | inputOptionsBuilder.withFollowLocation(followLocation); 88 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 89 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json"); 90 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 91 | 92 | return httpClient.doPost(uri, body, Overdue.class, requestOptions); 93 | } 94 | 95 | public String uploadOverdueConfigXml(final String body, final RequestOptions inputOptions) throws KillBillClientException { 96 | Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling uploadOverdueConfigXml"); 97 | 98 | final String uri = "/1.0/kb/overdue/xml"; 99 | 100 | 101 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 102 | final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE); 103 | inputOptionsBuilder.withFollowLocation(followLocation); 104 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "text/xml"); 105 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 106 | 107 | return httpClient.doPost(uri, body, String.class, requestOptions); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/api/gen/PluginInfoApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.api.gen; 22 | 23 | import java.util.Objects; 24 | 25 | import org.killbill.billing.client.model.gen.PluginInfo; 26 | import org.killbill.billing.client.model.PluginInfos; 27 | import java.util.List; 28 | 29 | import org.killbill.billing.client.Converter; 30 | import org.killbill.billing.client.KillBillClientException; 31 | import org.killbill.billing.client.KillBillHttpClient; 32 | import org.killbill.billing.client.RequestOptions; 33 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 34 | 35 | import org.killbill.billing.client.util.Preconditions; 36 | import org.killbill.billing.client.util.Multimap; 37 | import org.killbill.billing.client.util.TreeMapSetMultimap; 38 | 39 | /** 40 | * DO NOT EDIT !!! 41 | * 42 | * This code has been generated by the Kill Bill swagger generator. 43 | * @See https://github.com/killbill/killbill-swagger-coden 44 | */ 45 | public class PluginInfoApi { 46 | 47 | private final KillBillHttpClient httpClient; 48 | 49 | public PluginInfoApi() { 50 | this(new KillBillHttpClient()); 51 | } 52 | 53 | public PluginInfoApi(final KillBillHttpClient httpClient) { 54 | this.httpClient = httpClient; 55 | } 56 | 57 | public PluginInfos getPluginsInfo(final RequestOptions inputOptions) throws KillBillClientException { 58 | 59 | final String uri = "/1.0/kb/pluginsInfo"; 60 | 61 | 62 | final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend(); 63 | inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json"); 64 | final RequestOptions requestOptions = inputOptionsBuilder.build(); 65 | 66 | return httpClient.doGet(uri, PluginInfos.class, requestOptions); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/AccountEmails.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.model.gen.AccountEmail; 23 | 24 | public class AccountEmails extends KillBillObjects { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Accounts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Account; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Accounts extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Accounts getNext() throws KillBillClientException { 31 | return getNext(Accounts.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/AuditLogs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.AuditLog; 25 | 26 | public class AuditLogs extends ArrayList { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/BlockingStates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.BlockingState; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class BlockingStates extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public BlockingStates getNext() throws KillBillClientException { 31 | return getNext(BlockingStates.class); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/BulkSubscriptionsBundles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.BulkSubscriptionsBundle; 25 | 26 | public class BulkSubscriptionsBundles extends ArrayList { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Bundles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Bundle; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Bundles extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Bundles getNext() throws KillBillClientException { 31 | return getNext(Bundles.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/CatalogVersions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.joda.time.DateTime; 25 | 26 | public class CatalogVersions extends ArrayList { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Catalogs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.Catalog; 25 | 26 | public class Catalogs extends ArrayList { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/CustomFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.CustomField; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class CustomFields extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public CustomFields getNext() throws KillBillClientException { 31 | return getNext(CustomFields.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/DateTimes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.joda.time.DateTime; 25 | 26 | public class DateTimes extends ArrayList { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/InvoiceItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.model.gen.InvoiceItem; 23 | 24 | public class InvoiceItems extends KillBillObjects { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/InvoicePayments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.InvoicePayment; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class InvoicePayments extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public InvoicePayments getNext() throws KillBillClientException { 31 | return getNext(InvoicePayments.class); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Invoices.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Invoice; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Invoices extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Invoices getNext() throws KillBillClientException { 31 | return getNext(Invoices.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/KillBillObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | 23 | import java.util.List; 24 | import java.util.Objects; 25 | 26 | import javax.annotation.Nullable; 27 | 28 | import org.killbill.billing.client.model.gen.AuditLog; 29 | 30 | public abstract class KillBillObject { 31 | 32 | protected List auditLogs; 33 | 34 | public KillBillObject() { 35 | this(null); 36 | } 37 | 38 | public KillBillObject(@Nullable final List auditLogs) { 39 | this.auditLogs = auditLogs; 40 | } 41 | 42 | public List getAuditLogs() { 43 | return auditLogs; 44 | } 45 | 46 | public void setAuditLogs(final List auditLogs) { 47 | this.auditLogs = auditLogs; 48 | } 49 | 50 | @Override 51 | public boolean equals(final Object o) { 52 | if (this == o) { 53 | return true; 54 | } 55 | if (!(o instanceof KillBillObject)) { 56 | return false; 57 | } 58 | final KillBillObject that = (KillBillObject) o; 59 | return Objects.equals(auditLogs, that.auditLogs); 60 | } 61 | 62 | @Override 63 | public int hashCode() { 64 | return Objects.hash(auditLogs); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/KillBillObjects.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.KillBillClientException; 25 | import org.killbill.billing.client.KillBillHttpClient; 26 | import org.killbill.billing.client.RequestOptions; 27 | 28 | import com.fasterxml.jackson.annotation.JsonIgnore; 29 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 30 | 31 | @JsonIgnoreProperties(ignoreUnknown = true) 32 | public abstract class KillBillObjects extends ArrayList { 33 | 34 | @JsonIgnore 35 | private KillBillHttpClient killBillHttpClient; 36 | 37 | @JsonIgnore 38 | private int paginationCurrentOffset; 39 | 40 | @JsonIgnore 41 | private int paginationNextOffset; 42 | 43 | @JsonIgnore 44 | private int paginationTotalNbRecords; 45 | 46 | @JsonIgnore 47 | private int paginationMaxNbRecords; 48 | 49 | @JsonIgnore 50 | private String paginationNextPageUri; 51 | 52 | @JsonIgnore 53 | public > U getNext(final Class clazz) throws KillBillClientException { 54 | if (killBillHttpClient == null || paginationNextPageUri == null) { 55 | return null; 56 | } 57 | return killBillHttpClient.doGet(paginationNextPageUri, clazz, RequestOptions.empty()); 58 | } 59 | 60 | @JsonIgnore 61 | public KillBillHttpClient getKillBillHttpClient() { 62 | return killBillHttpClient; 63 | } 64 | 65 | @JsonIgnore 66 | public void setKillBillHttpClient(final KillBillHttpClient killBillHttpClient) { 67 | this.killBillHttpClient = killBillHttpClient; 68 | } 69 | 70 | @JsonIgnore 71 | public int getPaginationCurrentOffset() { 72 | return paginationCurrentOffset; 73 | } 74 | 75 | @JsonIgnore 76 | public void setPaginationCurrentOffset(final int paginationCurrentOffset) { 77 | this.paginationCurrentOffset = paginationCurrentOffset; 78 | } 79 | 80 | @JsonIgnore 81 | public int getPaginationNextOffset() { 82 | return paginationNextOffset; 83 | } 84 | 85 | @JsonIgnore 86 | public void setPaginationNextOffset(final int paginationNextOffset) { 87 | this.paginationNextOffset = paginationNextOffset; 88 | } 89 | 90 | @JsonIgnore 91 | public int getPaginationTotalNbRecords() { 92 | return paginationTotalNbRecords; 93 | } 94 | 95 | @JsonIgnore 96 | public void setPaginationTotalNbRecords(final int paginationTotalNbRecords) { 97 | this.paginationTotalNbRecords = paginationTotalNbRecords; 98 | } 99 | 100 | @JsonIgnore 101 | public int getPaginationMaxNbRecords() { 102 | return paginationMaxNbRecords; 103 | } 104 | 105 | @JsonIgnore 106 | public void setPaginationMaxNbRecords(final int paginationMaxNbRecords) { 107 | this.paginationMaxNbRecords = paginationMaxNbRecords; 108 | } 109 | 110 | @JsonIgnore 111 | public String getPaginationNextPageUri() { 112 | return paginationNextPageUri; 113 | } 114 | 115 | @JsonIgnore 116 | public void setPaginationNextPageUri(final String paginationNextPageUri) { 117 | this.paginationNextPageUri = paginationNextPageUri; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/NodeInfos.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2022 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.NodeInfo; 25 | 26 | public class NodeInfos extends ArrayList { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/PaymentMethods.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.PaymentMethod; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class PaymentMethods extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public PaymentMethods getNext() throws KillBillClientException { 31 | return getNext(PaymentMethods.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Payments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Payment; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Payments extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Payments getNext() throws KillBillClientException { 31 | return getNext(Payments.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/PlanDetails.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.PlanDetail; 25 | 26 | public class PlanDetails extends ArrayList { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/PluginInfos.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | import org.killbill.billing.client.model.gen.PluginInfo; 25 | 26 | public class PluginInfos extends ArrayList { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Strings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import java.util.ArrayList; 23 | 24 | public class Strings extends ArrayList { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Subscriptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Subscription; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Subscriptions extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Subscriptions getNext() throws KillBillClientException { 31 | return getNext(Subscriptions.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/TagDefinitions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.model.gen.TagDefinition; 23 | 24 | public class TagDefinitions extends KillBillObjects { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/Tags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2020 Equinix, Inc 5 | * Copyright 2014-2020 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.killbill.billing.client.model; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.model.gen.Tag; 24 | 25 | import com.fasterxml.jackson.annotation.JsonIgnore; 26 | 27 | public class Tags extends KillBillObjects { 28 | 29 | @JsonIgnore 30 | public Tags getNext() throws KillBillClientException { 31 | return getNext(Tags.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/TenantKeyValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2021 Equinix, Inc 3 | * Copyright 2014-2021 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.model; 19 | 20 | import org.killbill.billing.client.KillBillClientException; 21 | import org.killbill.billing.client.model.gen.TenantKeyValue; 22 | 23 | import com.fasterxml.jackson.annotation.JsonIgnore; 24 | 25 | public class TenantKeyValues extends KillBillObjects { 26 | 27 | @JsonIgnore 28 | public TenantKeyValues getNext() throws KillBillClientException { 29 | return getNext(TenantKeyValues.class); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/AccountEmail.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import java.util.UUID; 28 | import org.killbill.billing.client.model.gen.AuditLog; 29 | 30 | /** 31 | * DO NOT EDIT !!! 32 | * 33 | * This code has been generated by the Kill Bill swagger generator. 34 | * @See https://github.com/killbill/killbill-swagger-coden 35 | */ 36 | import org.killbill.billing.client.model.KillBillObject; 37 | 38 | public class AccountEmail extends KillBillObject { 39 | 40 | private UUID accountId = null; 41 | 42 | private String email = null; 43 | 44 | 45 | 46 | public AccountEmail() { 47 | } 48 | 49 | public AccountEmail(final UUID accountId, 50 | final String email, 51 | final List auditLogs) { 52 | super(auditLogs); 53 | this.accountId = accountId; 54 | this.email = email; 55 | 56 | } 57 | 58 | 59 | public AccountEmail setAccountId(final UUID accountId) { 60 | this.accountId = accountId; 61 | return this; 62 | } 63 | 64 | public UUID getAccountId() { 65 | return accountId; 66 | } 67 | 68 | public AccountEmail setEmail(final String email) { 69 | this.email = email; 70 | return this; 71 | } 72 | 73 | public String getEmail() { 74 | return email; 75 | } 76 | 77 | @Override 78 | public boolean equals(java.lang.Object o) { 79 | if (this == o) { 80 | return true; 81 | } 82 | if (o == null || getClass() != o.getClass()) { 83 | return false; 84 | } 85 | AccountEmail accountEmail = (AccountEmail) o; 86 | return Objects.equals(this.accountId, accountEmail.accountId) && 87 | Objects.equals(this.email, accountEmail.email) && 88 | true /* ignoring this.auditLogs for identity operations */; 89 | } 90 | 91 | @Override 92 | public int hashCode() { 93 | return Objects.hash(accountId, 94 | email, 95 | 0 /* ignoring auditLogs for identity operations */ ); 96 | } 97 | 98 | @Override 99 | public String toString() { 100 | StringBuilder sb = new StringBuilder(); 101 | sb.append("class AccountEmail {\n"); 102 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 103 | sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); 104 | sb.append(" email: ").append(toIndentedString(email)).append("\n"); 105 | sb.append(" auditLogs: ").append(toIndentedString(auditLogs)).append("\n"); 106 | sb.append("}"); 107 | return sb.toString(); 108 | } 109 | 110 | /** 111 | * Convert the given object to string with each line indented by 4 spaces 112 | * (except the first line). 113 | */ 114 | private String toIndentedString(java.lang.Object o) { 115 | if (o == null) { 116 | return "null"; 117 | } 118 | return o.toString().replace("\n", "\n "); 119 | } 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/AdminPayment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class AdminPayment { 35 | 36 | private String lastSuccessPaymentState = null; 37 | 38 | private String currentPaymentStateName = null; 39 | 40 | private String transactionStatus = null; 41 | 42 | 43 | public AdminPayment() { 44 | } 45 | 46 | public AdminPayment(final String lastSuccessPaymentState, 47 | final String currentPaymentStateName, 48 | final String transactionStatus) { 49 | this.lastSuccessPaymentState = lastSuccessPaymentState; 50 | this.currentPaymentStateName = currentPaymentStateName; 51 | this.transactionStatus = transactionStatus; 52 | 53 | } 54 | 55 | 56 | public AdminPayment setLastSuccessPaymentState(final String lastSuccessPaymentState) { 57 | this.lastSuccessPaymentState = lastSuccessPaymentState; 58 | return this; 59 | } 60 | 61 | public String getLastSuccessPaymentState() { 62 | return lastSuccessPaymentState; 63 | } 64 | 65 | public AdminPayment setCurrentPaymentStateName(final String currentPaymentStateName) { 66 | this.currentPaymentStateName = currentPaymentStateName; 67 | return this; 68 | } 69 | 70 | public String getCurrentPaymentStateName() { 71 | return currentPaymentStateName; 72 | } 73 | 74 | public AdminPayment setTransactionStatus(final String transactionStatus) { 75 | this.transactionStatus = transactionStatus; 76 | return this; 77 | } 78 | 79 | public String getTransactionStatus() { 80 | return transactionStatus; 81 | } 82 | 83 | @Override 84 | public boolean equals(java.lang.Object o) { 85 | if (this == o) { 86 | return true; 87 | } 88 | if (o == null || getClass() != o.getClass()) { 89 | return false; 90 | } 91 | AdminPayment adminPayment = (AdminPayment) o; 92 | return Objects.equals(this.lastSuccessPaymentState, adminPayment.lastSuccessPaymentState) && 93 | Objects.equals(this.currentPaymentStateName, adminPayment.currentPaymentStateName) && 94 | Objects.equals(this.transactionStatus, adminPayment.transactionStatus); 95 | } 96 | 97 | @Override 98 | public int hashCode() { 99 | return Objects.hash(lastSuccessPaymentState, 100 | currentPaymentStateName, 101 | transactionStatus); 102 | } 103 | 104 | @Override 105 | public String toString() { 106 | StringBuilder sb = new StringBuilder(); 107 | sb.append("class AdminPayment {\n"); 108 | 109 | sb.append(" lastSuccessPaymentState: ").append(toIndentedString(lastSuccessPaymentState)).append("\n"); 110 | sb.append(" currentPaymentStateName: ").append(toIndentedString(currentPaymentStateName)).append("\n"); 111 | sb.append(" transactionStatus: ").append(toIndentedString(transactionStatus)).append("\n"); 112 | sb.append("}"); 113 | return sb.toString(); 114 | } 115 | 116 | /** 117 | * Convert the given object to string with each line indented by 4 spaces 118 | * (except the first line). 119 | */ 120 | private String toIndentedString(java.lang.Object o) { 121 | if (o == null) { 122 | return "null"; 123 | } 124 | return o.toString().replace("\n", "\n "); 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/BlockPrice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.math.BigDecimal; 26 | 27 | /** 28 | * DO NOT EDIT !!! 29 | * 30 | * This code has been generated by the Kill Bill swagger generator. 31 | * @See https://github.com/killbill/killbill-swagger-coden 32 | */ 33 | import org.killbill.billing.client.model.KillBillObject; 34 | 35 | public class BlockPrice { 36 | 37 | private String unitName = null; 38 | 39 | private BigDecimal size = null; 40 | 41 | private BigDecimal price = null; 42 | 43 | private BigDecimal max = null; 44 | 45 | 46 | public BlockPrice() { 47 | } 48 | 49 | public BlockPrice(final String unitName, 50 | final BigDecimal size, 51 | final BigDecimal price, 52 | final BigDecimal max) { 53 | this.unitName = unitName; 54 | this.size = size; 55 | this.price = price; 56 | this.max = max; 57 | 58 | } 59 | 60 | 61 | public BlockPrice setUnitName(final String unitName) { 62 | this.unitName = unitName; 63 | return this; 64 | } 65 | 66 | public String getUnitName() { 67 | return unitName; 68 | } 69 | 70 | public BlockPrice setSize(final BigDecimal size) { 71 | this.size = size; 72 | return this; 73 | } 74 | 75 | public BigDecimal getSize() { 76 | return size; 77 | } 78 | 79 | public BlockPrice setPrice(final BigDecimal price) { 80 | this.price = price; 81 | return this; 82 | } 83 | 84 | public BigDecimal getPrice() { 85 | return price; 86 | } 87 | 88 | public BlockPrice setMax(final BigDecimal max) { 89 | this.max = max; 90 | return this; 91 | } 92 | 93 | public BigDecimal getMax() { 94 | return max; 95 | } 96 | 97 | @Override 98 | public boolean equals(java.lang.Object o) { 99 | if (this == o) { 100 | return true; 101 | } 102 | if (o == null || getClass() != o.getClass()) { 103 | return false; 104 | } 105 | BlockPrice blockPrice = (BlockPrice) o; 106 | return Objects.equals(this.unitName, blockPrice.unitName) && 107 | Objects.equals(this.size, blockPrice.size) && 108 | Objects.equals(this.price, blockPrice.price) && 109 | Objects.equals(this.max, blockPrice.max); 110 | } 111 | 112 | @Override 113 | public int hashCode() { 114 | return Objects.hash(unitName, 115 | size, 116 | price, 117 | max); 118 | } 119 | 120 | @Override 121 | public String toString() { 122 | StringBuilder sb = new StringBuilder(); 123 | sb.append("class BlockPrice {\n"); 124 | 125 | sb.append(" unitName: ").append(toIndentedString(unitName)).append("\n"); 126 | sb.append(" size: ").append(toIndentedString(size)).append("\n"); 127 | sb.append(" price: ").append(toIndentedString(price)).append("\n"); 128 | sb.append(" max: ").append(toIndentedString(max)).append("\n"); 129 | sb.append("}"); 130 | return sb.toString(); 131 | } 132 | 133 | /** 134 | * Convert the given object to string with each line indented by 4 spaces 135 | * (except the first line). 136 | */ 137 | private String toIndentedString(java.lang.Object o) { 138 | if (o == null) { 139 | return "null"; 140 | } 141 | return o.toString().replace("\n", "\n "); 142 | } 143 | } 144 | 145 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/BulkSubscriptionsBundle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.Subscription; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class BulkSubscriptionsBundle { 38 | 39 | private List baseEntitlementAndAddOns = new ArrayList(); 40 | 41 | 42 | public BulkSubscriptionsBundle() { 43 | } 44 | 45 | public BulkSubscriptionsBundle(final List baseEntitlementAndAddOns) { 46 | this.baseEntitlementAndAddOns = baseEntitlementAndAddOns; 47 | 48 | } 49 | 50 | 51 | public BulkSubscriptionsBundle setBaseEntitlementAndAddOns(final List baseEntitlementAndAddOns) { 52 | this.baseEntitlementAndAddOns = baseEntitlementAndAddOns; 53 | return this; 54 | } 55 | 56 | public BulkSubscriptionsBundle addBaseEntitlementAndAddOnsItem(final Subscription baseEntitlementAndAddOnsItem) { 57 | this.baseEntitlementAndAddOns.add(baseEntitlementAndAddOnsItem); 58 | return this; 59 | } 60 | 61 | public List getBaseEntitlementAndAddOns() { 62 | return baseEntitlementAndAddOns; 63 | } 64 | 65 | @Override 66 | public boolean equals(java.lang.Object o) { 67 | if (this == o) { 68 | return true; 69 | } 70 | if (o == null || getClass() != o.getClass()) { 71 | return false; 72 | } 73 | BulkSubscriptionsBundle bulkSubscriptionsBundle = (BulkSubscriptionsBundle) o; 74 | return Objects.equals(this.baseEntitlementAndAddOns, bulkSubscriptionsBundle.baseEntitlementAndAddOns); 75 | } 76 | 77 | @Override 78 | public int hashCode() { 79 | return Objects.hash(baseEntitlementAndAddOns); 80 | } 81 | 82 | @Override 83 | public String toString() { 84 | StringBuilder sb = new StringBuilder(); 85 | sb.append("class BulkSubscriptionsBundle {\n"); 86 | 87 | sb.append(" baseEntitlementAndAddOns: ").append(toIndentedString(baseEntitlementAndAddOns)).append("\n"); 88 | sb.append("}"); 89 | return sb.toString(); 90 | } 91 | 92 | /** 93 | * Convert the given object to string with each line indented by 4 spaces 94 | * (except the first line). 95 | */ 96 | private String toIndentedString(java.lang.Object o) { 97 | if (o == null) { 98 | return "null"; 99 | } 100 | return o.toString().replace("\n", "\n "); 101 | } 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/CatalogValidation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.CatalogValidationError; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class CatalogValidation { 38 | 39 | private List catalogValidationErrors = null; 40 | 41 | 42 | public CatalogValidation() { 43 | } 44 | 45 | public CatalogValidation(final List catalogValidationErrors) { 46 | this.catalogValidationErrors = catalogValidationErrors; 47 | 48 | } 49 | 50 | 51 | public CatalogValidation setCatalogValidationErrors(final List catalogValidationErrors) { 52 | this.catalogValidationErrors = catalogValidationErrors; 53 | return this; 54 | } 55 | 56 | public CatalogValidation addCatalogValidationErrorsItem(final CatalogValidationError catalogValidationErrorsItem) { 57 | if (this.catalogValidationErrors == null) { 58 | this.catalogValidationErrors = new ArrayList(); 59 | } 60 | this.catalogValidationErrors.add(catalogValidationErrorsItem); 61 | return this; 62 | } 63 | 64 | public List getCatalogValidationErrors() { 65 | return catalogValidationErrors; 66 | } 67 | 68 | @Override 69 | public boolean equals(java.lang.Object o) { 70 | if (this == o) { 71 | return true; 72 | } 73 | if (o == null || getClass() != o.getClass()) { 74 | return false; 75 | } 76 | CatalogValidation catalogValidation = (CatalogValidation) o; 77 | return Objects.equals(this.catalogValidationErrors, catalogValidation.catalogValidationErrors); 78 | } 79 | 80 | @Override 81 | public int hashCode() { 82 | return Objects.hash(catalogValidationErrors); 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | StringBuilder sb = new StringBuilder(); 88 | sb.append("class CatalogValidation {\n"); 89 | 90 | sb.append(" catalogValidationErrors: ").append(toIndentedString(catalogValidationErrors)).append("\n"); 91 | sb.append("}"); 92 | return sb.toString(); 93 | } 94 | 95 | /** 96 | * Convert the given object to string with each line indented by 4 spaces 97 | * (except the first line). 98 | */ 99 | private String toIndentedString(java.lang.Object o) { 100 | if (o == null) { 101 | return "null"; 102 | } 103 | return o.toString().replace("\n", "\n "); 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/CatalogValidationError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class CatalogValidationError { 35 | 36 | private String errorDescription = null; 37 | 38 | 39 | public CatalogValidationError() { 40 | } 41 | 42 | public CatalogValidationError(final String errorDescription) { 43 | this.errorDescription = errorDescription; 44 | 45 | } 46 | 47 | 48 | public CatalogValidationError setErrorDescription(final String errorDescription) { 49 | this.errorDescription = errorDescription; 50 | return this; 51 | } 52 | 53 | public String getErrorDescription() { 54 | return errorDescription; 55 | } 56 | 57 | @Override 58 | public boolean equals(java.lang.Object o) { 59 | if (this == o) { 60 | return true; 61 | } 62 | if (o == null || getClass() != o.getClass()) { 63 | return false; 64 | } 65 | CatalogValidationError catalogValidationError = (CatalogValidationError) o; 66 | return Objects.equals(this.errorDescription, catalogValidationError.errorDescription); 67 | } 68 | 69 | @Override 70 | public int hashCode() { 71 | return Objects.hash(errorDescription); 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | StringBuilder sb = new StringBuilder(); 77 | sb.append("class CatalogValidationError {\n"); 78 | 79 | sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).append("\n"); 80 | sb.append("}"); 81 | return sb.toString(); 82 | } 83 | 84 | /** 85 | * Convert the given object to string with each line indented by 4 spaces 86 | * (except the first line). 87 | */ 88 | private String toIndentedString(java.lang.Object o) { 89 | if (o == null) { 90 | return "null"; 91 | } 92 | return o.toString().replace("\n", "\n "); 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Duration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import org.killbill.billing.catalog.api.TimeUnit; 26 | 27 | /** 28 | * DO NOT EDIT !!! 29 | * 30 | * This code has been generated by the Kill Bill swagger generator. 31 | * @See https://github.com/killbill/killbill-swagger-coden 32 | */ 33 | import org.killbill.billing.client.model.KillBillObject; 34 | 35 | public class Duration { 36 | 37 | private TimeUnit unit = null; 38 | 39 | private Integer number = null; 40 | 41 | 42 | public Duration() { 43 | } 44 | 45 | public Duration(final TimeUnit unit, 46 | final Integer number) { 47 | this.unit = unit; 48 | this.number = number; 49 | 50 | } 51 | 52 | 53 | public Duration setUnit(final TimeUnit unit) { 54 | this.unit = unit; 55 | return this; 56 | } 57 | 58 | public TimeUnit getUnit() { 59 | return unit; 60 | } 61 | 62 | public Duration setNumber(final Integer number) { 63 | this.number = number; 64 | return this; 65 | } 66 | 67 | public Integer getNumber() { 68 | return number; 69 | } 70 | 71 | @Override 72 | public boolean equals(java.lang.Object o) { 73 | if (this == o) { 74 | return true; 75 | } 76 | if (o == null || getClass() != o.getClass()) { 77 | return false; 78 | } 79 | Duration duration = (Duration) o; 80 | return Objects.equals(this.unit, duration.unit) && 81 | Objects.equals(this.number, duration.number); 82 | } 83 | 84 | @Override 85 | public int hashCode() { 86 | return Objects.hash(unit, 87 | number); 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | StringBuilder sb = new StringBuilder(); 93 | sb.append("class Duration {\n"); 94 | 95 | sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); 96 | sb.append(" number: ").append(toIndentedString(number)).append("\n"); 97 | sb.append("}"); 98 | return sb.toString(); 99 | } 100 | 101 | /** 102 | * Convert the given object to string with each line indented by 4 spaces 103 | * (except the first line). 104 | */ 105 | private String toIndentedString(java.lang.Object o) { 106 | if (o == null) { 107 | return "null"; 108 | } 109 | return o.toString().replace("\n", "\n "); 110 | } 111 | } 112 | 113 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/HostedPaymentPageFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.PluginProperty; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class HostedPaymentPageFields { 38 | 39 | private List formFields = null; 40 | 41 | 42 | public HostedPaymentPageFields() { 43 | } 44 | 45 | public HostedPaymentPageFields(final List formFields) { 46 | this.formFields = formFields; 47 | 48 | } 49 | 50 | 51 | public HostedPaymentPageFields setFormFields(final List formFields) { 52 | this.formFields = formFields; 53 | return this; 54 | } 55 | 56 | public HostedPaymentPageFields addFormFieldsItem(final PluginProperty formFieldsItem) { 57 | if (this.formFields == null) { 58 | this.formFields = new ArrayList(); 59 | } 60 | this.formFields.add(formFieldsItem); 61 | return this; 62 | } 63 | 64 | public List getFormFields() { 65 | return formFields; 66 | } 67 | 68 | @Override 69 | public boolean equals(java.lang.Object o) { 70 | if (this == o) { 71 | return true; 72 | } 73 | if (o == null || getClass() != o.getClass()) { 74 | return false; 75 | } 76 | HostedPaymentPageFields hostedPaymentPageFields = (HostedPaymentPageFields) o; 77 | return Objects.equals(this.formFields, hostedPaymentPageFields.formFields); 78 | } 79 | 80 | @Override 81 | public int hashCode() { 82 | return Objects.hash(formFields); 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | StringBuilder sb = new StringBuilder(); 88 | sb.append("class HostedPaymentPageFields {\n"); 89 | 90 | sb.append(" formFields: ").append(toIndentedString(formFields)).append("\n"); 91 | sb.append("}"); 92 | return sb.toString(); 93 | } 94 | 95 | /** 96 | * Convert the given object to string with each line indented by 4 spaces 97 | * (except the first line). 98 | */ 99 | private String toIndentedString(java.lang.Object o) { 100 | if (o == null) { 101 | return "null"; 102 | } 103 | return o.toString().replace("\n", "\n "); 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Limit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class Limit { 35 | 36 | private String unit = null; 37 | 38 | private String max = null; 39 | 40 | private String min = null; 41 | 42 | 43 | public Limit() { 44 | } 45 | 46 | public Limit(final String unit, 47 | final String max, 48 | final String min) { 49 | this.unit = unit; 50 | this.max = max; 51 | this.min = min; 52 | 53 | } 54 | 55 | 56 | public Limit setUnit(final String unit) { 57 | this.unit = unit; 58 | return this; 59 | } 60 | 61 | public String getUnit() { 62 | return unit; 63 | } 64 | 65 | public Limit setMax(final String max) { 66 | this.max = max; 67 | return this; 68 | } 69 | 70 | public String getMax() { 71 | return max; 72 | } 73 | 74 | public Limit setMin(final String min) { 75 | this.min = min; 76 | return this; 77 | } 78 | 79 | public String getMin() { 80 | return min; 81 | } 82 | 83 | @Override 84 | public boolean equals(java.lang.Object o) { 85 | if (this == o) { 86 | return true; 87 | } 88 | if (o == null || getClass() != o.getClass()) { 89 | return false; 90 | } 91 | Limit limit = (Limit) o; 92 | return Objects.equals(this.unit, limit.unit) && 93 | Objects.equals(this.max, limit.max) && 94 | Objects.equals(this.min, limit.min); 95 | } 96 | 97 | @Override 98 | public int hashCode() { 99 | return Objects.hash(unit, 100 | max, 101 | min); 102 | } 103 | 104 | @Override 105 | public String toString() { 106 | StringBuilder sb = new StringBuilder(); 107 | sb.append("class Limit {\n"); 108 | 109 | sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); 110 | sb.append(" max: ").append(toIndentedString(max)).append("\n"); 111 | sb.append(" min: ").append(toIndentedString(min)).append("\n"); 112 | sb.append("}"); 113 | return sb.toString(); 114 | } 115 | 116 | /** 117 | * Convert the given object to string with each line indented by 4 spaces 118 | * (except the first line). 119 | */ 120 | private String toIndentedString(java.lang.Object o) { 121 | if (o == null) { 122 | return "null"; 123 | } 124 | return o.toString().replace("\n", "\n "); 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/NodeCommandProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class NodeCommandProperty { 35 | 36 | private String key = null; 37 | 38 | private Object value = null; 39 | 40 | 41 | public NodeCommandProperty() { 42 | } 43 | 44 | public NodeCommandProperty(final String key, 45 | final Object value) { 46 | this.key = key; 47 | this.value = value; 48 | 49 | } 50 | 51 | 52 | public NodeCommandProperty setKey(final String key) { 53 | this.key = key; 54 | return this; 55 | } 56 | 57 | public String getKey() { 58 | return key; 59 | } 60 | 61 | public NodeCommandProperty setValue(final Object value) { 62 | this.value = value; 63 | return this; 64 | } 65 | 66 | public Object getValue() { 67 | return value; 68 | } 69 | 70 | @Override 71 | public boolean equals(java.lang.Object o) { 72 | if (this == o) { 73 | return true; 74 | } 75 | if (o == null || getClass() != o.getClass()) { 76 | return false; 77 | } 78 | NodeCommandProperty nodeCommandProperty = (NodeCommandProperty) o; 79 | return Objects.equals(this.key, nodeCommandProperty.key) && 80 | Objects.equals(this.value, nodeCommandProperty.value); 81 | } 82 | 83 | @Override 84 | public int hashCode() { 85 | return Objects.hash(key, 86 | value); 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | StringBuilder sb = new StringBuilder(); 92 | sb.append("class NodeCommandProperty {\n"); 93 | 94 | sb.append(" key: ").append(toIndentedString(key)).append("\n"); 95 | sb.append(" value: ").append(toIndentedString(value)).append("\n"); 96 | sb.append("}"); 97 | return sb.toString(); 98 | } 99 | 100 | /** 101 | * Convert the given object to string with each line indented by 4 spaces 102 | * (except the first line). 103 | */ 104 | private String toIndentedString(java.lang.Object o) { 105 | if (o == null) { 106 | return "null"; 107 | } 108 | return o.toString().replace("\n", "\n "); 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Overdue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.OverdueStateConfig; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class Overdue { 38 | 39 | private Integer initialReevaluationInterval = null; 40 | 41 | private List overdueStates = null; 42 | 43 | 44 | public Overdue() { 45 | } 46 | 47 | public Overdue(final Integer initialReevaluationInterval, 48 | final List overdueStates) { 49 | this.initialReevaluationInterval = initialReevaluationInterval; 50 | this.overdueStates = overdueStates; 51 | 52 | } 53 | 54 | 55 | public Overdue setInitialReevaluationInterval(final Integer initialReevaluationInterval) { 56 | this.initialReevaluationInterval = initialReevaluationInterval; 57 | return this; 58 | } 59 | 60 | public Integer getInitialReevaluationInterval() { 61 | return initialReevaluationInterval; 62 | } 63 | 64 | public Overdue setOverdueStates(final List overdueStates) { 65 | this.overdueStates = overdueStates; 66 | return this; 67 | } 68 | 69 | public Overdue addOverdueStatesItem(final OverdueStateConfig overdueStatesItem) { 70 | if (this.overdueStates == null) { 71 | this.overdueStates = new ArrayList(); 72 | } 73 | this.overdueStates.add(overdueStatesItem); 74 | return this; 75 | } 76 | 77 | public List getOverdueStates() { 78 | return overdueStates; 79 | } 80 | 81 | @Override 82 | public boolean equals(java.lang.Object o) { 83 | if (this == o) { 84 | return true; 85 | } 86 | if (o == null || getClass() != o.getClass()) { 87 | return false; 88 | } 89 | Overdue overdue = (Overdue) o; 90 | return Objects.equals(this.initialReevaluationInterval, overdue.initialReevaluationInterval) && 91 | Objects.equals(this.overdueStates, overdue.overdueStates); 92 | } 93 | 94 | @Override 95 | public int hashCode() { 96 | return Objects.hash(initialReevaluationInterval, 97 | overdueStates); 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | StringBuilder sb = new StringBuilder(); 103 | sb.append("class Overdue {\n"); 104 | 105 | sb.append(" initialReevaluationInterval: ").append(toIndentedString(initialReevaluationInterval)).append("\n"); 106 | sb.append(" overdueStates: ").append(toIndentedString(overdueStates)).append("\n"); 107 | sb.append("}"); 108 | return sb.toString(); 109 | } 110 | 111 | /** 112 | * Convert the given object to string with each line indented by 4 spaces 113 | * (except the first line). 114 | */ 115 | private String toIndentedString(java.lang.Object o) { 116 | if (o == null) { 117 | return "null"; 118 | } 119 | return o.toString().replace("\n", "\n "); 120 | } 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/PluginProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import com.fasterxml.jackson.annotation.JsonProperty; 26 | 27 | /** 28 | * DO NOT EDIT !!! 29 | * 30 | * This code has been generated by the Kill Bill swagger generator. 31 | * @See https://github.com/killbill/killbill-swagger-coden 32 | */ 33 | import org.killbill.billing.client.model.KillBillObject; 34 | 35 | public class PluginProperty { 36 | 37 | private String key = null; 38 | 39 | private String value = null; 40 | 41 | private Boolean isUpdatable = null; 42 | 43 | 44 | public PluginProperty() { 45 | } 46 | 47 | public PluginProperty(final String key, 48 | final String value, 49 | final Boolean isUpdatable) { 50 | this.key = key; 51 | this.value = value; 52 | this.isUpdatable = isUpdatable; 53 | 54 | } 55 | 56 | 57 | public PluginProperty setKey(final String key) { 58 | this.key = key; 59 | return this; 60 | } 61 | 62 | public String getKey() { 63 | return key; 64 | } 65 | 66 | public PluginProperty setValue(final String value) { 67 | this.value = value; 68 | return this; 69 | } 70 | 71 | public String getValue() { 72 | return value; 73 | } 74 | 75 | public PluginProperty setIsUpdatable(final Boolean isUpdatable) { 76 | this.isUpdatable = isUpdatable; 77 | return this; 78 | } 79 | 80 | @JsonProperty(value="isUpdatable") 81 | public Boolean isUpdatable() { 82 | return isUpdatable; 83 | } 84 | 85 | @Override 86 | public boolean equals(java.lang.Object o) { 87 | if (this == o) { 88 | return true; 89 | } 90 | if (o == null || getClass() != o.getClass()) { 91 | return false; 92 | } 93 | PluginProperty pluginProperty = (PluginProperty) o; 94 | return Objects.equals(this.key, pluginProperty.key) && 95 | Objects.equals(this.value, pluginProperty.value) && 96 | Objects.equals(this.isUpdatable, pluginProperty.isUpdatable); 97 | } 98 | 99 | @Override 100 | public int hashCode() { 101 | return Objects.hash(key, 102 | value, 103 | isUpdatable); 104 | } 105 | 106 | @Override 107 | public String toString() { 108 | StringBuilder sb = new StringBuilder(); 109 | sb.append("class PluginProperty {\n"); 110 | 111 | sb.append(" key: ").append(toIndentedString(key)).append("\n"); 112 | sb.append(" value: ").append(toIndentedString(value)).append("\n"); 113 | sb.append(" isUpdatable: ").append(toIndentedString(isUpdatable)).append("\n"); 114 | sb.append("}"); 115 | return sb.toString(); 116 | } 117 | 118 | /** 119 | * Convert the given object to string with each line indented by 4 spaces 120 | * (except the first line). 121 | */ 122 | private String toIndentedString(java.lang.Object o) { 123 | if (o == null) { 124 | return "null"; 125 | } 126 | return o.toString().replace("\n", "\n "); 127 | } 128 | } 129 | 130 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/PluginServiceInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class PluginServiceInfo { 35 | 36 | private String serviceTypeName = null; 37 | 38 | private String registrationName = null; 39 | 40 | 41 | public PluginServiceInfo() { 42 | } 43 | 44 | public PluginServiceInfo(final String serviceTypeName, 45 | final String registrationName) { 46 | this.serviceTypeName = serviceTypeName; 47 | this.registrationName = registrationName; 48 | 49 | } 50 | 51 | 52 | public PluginServiceInfo setServiceTypeName(final String serviceTypeName) { 53 | this.serviceTypeName = serviceTypeName; 54 | return this; 55 | } 56 | 57 | public String getServiceTypeName() { 58 | return serviceTypeName; 59 | } 60 | 61 | public PluginServiceInfo setRegistrationName(final String registrationName) { 62 | this.registrationName = registrationName; 63 | return this; 64 | } 65 | 66 | public String getRegistrationName() { 67 | return registrationName; 68 | } 69 | 70 | @Override 71 | public boolean equals(java.lang.Object o) { 72 | if (this == o) { 73 | return true; 74 | } 75 | if (o == null || getClass() != o.getClass()) { 76 | return false; 77 | } 78 | PluginServiceInfo pluginServiceInfo = (PluginServiceInfo) o; 79 | return Objects.equals(this.serviceTypeName, pluginServiceInfo.serviceTypeName) && 80 | Objects.equals(this.registrationName, pluginServiceInfo.registrationName); 81 | } 82 | 83 | @Override 84 | public int hashCode() { 85 | return Objects.hash(serviceTypeName, 86 | registrationName); 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | StringBuilder sb = new StringBuilder(); 92 | sb.append("class PluginServiceInfo {\n"); 93 | 94 | sb.append(" serviceTypeName: ").append(toIndentedString(serviceTypeName)).append("\n"); 95 | sb.append(" registrationName: ").append(toIndentedString(registrationName)).append("\n"); 96 | sb.append("}"); 97 | return sb.toString(); 98 | } 99 | 100 | /** 101 | * Convert the given object to string with each line indented by 4 spaces 102 | * (except the first line). 103 | */ 104 | private String toIndentedString(java.lang.Object o) { 105 | if (o == null) { 106 | return "null"; 107 | } 108 | return o.toString().replace("\n", "\n "); 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Price.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.math.BigDecimal; 26 | import org.killbill.billing.catalog.api.Currency; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class Price { 37 | 38 | private Currency currency = null; 39 | 40 | private BigDecimal value = null; 41 | 42 | 43 | public Price() { 44 | } 45 | 46 | public Price(final Currency currency, 47 | final BigDecimal value) { 48 | this.currency = currency; 49 | this.value = value; 50 | 51 | } 52 | 53 | 54 | public Price setCurrency(final Currency currency) { 55 | this.currency = currency; 56 | return this; 57 | } 58 | 59 | public Currency getCurrency() { 60 | return currency; 61 | } 62 | 63 | public Price setValue(final BigDecimal value) { 64 | this.value = value; 65 | return this; 66 | } 67 | 68 | public BigDecimal getValue() { 69 | return value; 70 | } 71 | 72 | @Override 73 | public boolean equals(java.lang.Object o) { 74 | if (this == o) { 75 | return true; 76 | } 77 | if (o == null || getClass() != o.getClass()) { 78 | return false; 79 | } 80 | Price price = (Price) o; 81 | return Objects.equals(this.currency, price.currency) && 82 | Objects.equals(this.value, price.value); 83 | } 84 | 85 | @Override 86 | public int hashCode() { 87 | return Objects.hash(currency, 88 | value); 89 | } 90 | 91 | @Override 92 | public String toString() { 93 | StringBuilder sb = new StringBuilder(); 94 | sb.append("class Price {\n"); 95 | 96 | sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); 97 | sb.append(" value: ").append(toIndentedString(value)).append("\n"); 98 | sb.append("}"); 99 | return sb.toString(); 100 | } 101 | 102 | /** 103 | * Convert the given object to string with each line indented by 4 spaces 104 | * (except the first line). 105 | */ 106 | private String toIndentedString(java.lang.Object o) { 107 | if (o == null) { 108 | return "null"; 109 | } 110 | return o.toString().replace("\n", "\n "); 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/PriceList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class PriceList { 37 | 38 | private String name = null; 39 | 40 | private List plans = null; 41 | 42 | 43 | public PriceList() { 44 | } 45 | 46 | public PriceList(final String name, 47 | final List plans) { 48 | this.name = name; 49 | this.plans = plans; 50 | 51 | } 52 | 53 | 54 | public PriceList setName(final String name) { 55 | this.name = name; 56 | return this; 57 | } 58 | 59 | public String getName() { 60 | return name; 61 | } 62 | 63 | public PriceList setPlans(final List plans) { 64 | this.plans = plans; 65 | return this; 66 | } 67 | 68 | public PriceList addPlansItem(final String plansItem) { 69 | if (this.plans == null) { 70 | this.plans = new ArrayList(); 71 | } 72 | this.plans.add(plansItem); 73 | return this; 74 | } 75 | 76 | public List getPlans() { 77 | return plans; 78 | } 79 | 80 | @Override 81 | public boolean equals(java.lang.Object o) { 82 | if (this == o) { 83 | return true; 84 | } 85 | if (o == null || getClass() != o.getClass()) { 86 | return false; 87 | } 88 | PriceList priceList = (PriceList) o; 89 | return Objects.equals(this.name, priceList.name) && 90 | Objects.equals(this.plans, priceList.plans); 91 | } 92 | 93 | @Override 94 | public int hashCode() { 95 | return Objects.hash(name, 96 | plans); 97 | } 98 | 99 | @Override 100 | public String toString() { 101 | StringBuilder sb = new StringBuilder(); 102 | sb.append("class PriceList {\n"); 103 | 104 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 105 | sb.append(" plans: ").append(toIndentedString(plans)).append("\n"); 106 | sb.append("}"); 107 | return sb.toString(); 108 | } 109 | 110 | /** 111 | * Convert the given object to string with each line indented by 4 spaces 112 | * (except the first line). 113 | */ 114 | private String toIndentedString(java.lang.Object o) { 115 | if (o == null) { 116 | return "null"; 117 | } 118 | return o.toString().replace("\n", "\n "); 119 | } 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/RoleDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class RoleDefinition { 37 | 38 | private String role = null; 39 | 40 | private List permissions = new ArrayList(); 41 | 42 | 43 | public RoleDefinition() { 44 | } 45 | 46 | public RoleDefinition(final String role, 47 | final List permissions) { 48 | this.role = role; 49 | this.permissions = permissions; 50 | 51 | } 52 | 53 | 54 | public RoleDefinition setRole(final String role) { 55 | this.role = role; 56 | return this; 57 | } 58 | 59 | public String getRole() { 60 | return role; 61 | } 62 | 63 | public RoleDefinition setPermissions(final List permissions) { 64 | this.permissions = permissions; 65 | return this; 66 | } 67 | 68 | public RoleDefinition addPermissionsItem(final String permissionsItem) { 69 | this.permissions.add(permissionsItem); 70 | return this; 71 | } 72 | 73 | public List getPermissions() { 74 | return permissions; 75 | } 76 | 77 | @Override 78 | public boolean equals(java.lang.Object o) { 79 | if (this == o) { 80 | return true; 81 | } 82 | if (o == null || getClass() != o.getClass()) { 83 | return false; 84 | } 85 | RoleDefinition roleDefinition = (RoleDefinition) o; 86 | return Objects.equals(this.role, roleDefinition.role) && 87 | Objects.equals(this.permissions, roleDefinition.permissions); 88 | } 89 | 90 | @Override 91 | public int hashCode() { 92 | return Objects.hash(role, 93 | permissions); 94 | } 95 | 96 | @Override 97 | public String toString() { 98 | StringBuilder sb = new StringBuilder(); 99 | sb.append("class RoleDefinition {\n"); 100 | 101 | sb.append(" role: ").append(toIndentedString(role)).append("\n"); 102 | sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); 103 | sb.append("}"); 104 | return sb.toString(); 105 | } 106 | 107 | /** 108 | * Convert the given object to string with each line indented by 4 spaces 109 | * (except the first line). 110 | */ 111 | private String toIndentedString(java.lang.Object o) { 112 | if (o == null) { 113 | return "null"; 114 | } 115 | return o.toString().replace("\n", "\n "); 116 | } 117 | } 118 | 119 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/RolledUpUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.math.BigDecimal; 26 | 27 | /** 28 | * DO NOT EDIT !!! 29 | * 30 | * This code has been generated by the Kill Bill swagger generator. 31 | * @See https://github.com/killbill/killbill-swagger-coden 32 | */ 33 | import org.killbill.billing.client.model.KillBillObject; 34 | 35 | public class RolledUpUnit { 36 | 37 | private String unitType = null; 38 | 39 | private BigDecimal amount = null; 40 | 41 | 42 | public RolledUpUnit() { 43 | } 44 | 45 | public RolledUpUnit(final String unitType, 46 | final BigDecimal amount) { 47 | this.unitType = unitType; 48 | this.amount = amount; 49 | 50 | } 51 | 52 | 53 | public RolledUpUnit setUnitType(final String unitType) { 54 | this.unitType = unitType; 55 | return this; 56 | } 57 | 58 | public String getUnitType() { 59 | return unitType; 60 | } 61 | 62 | public RolledUpUnit setAmount(final BigDecimal amount) { 63 | this.amount = amount; 64 | return this; 65 | } 66 | 67 | public BigDecimal getAmount() { 68 | return amount; 69 | } 70 | 71 | @Override 72 | public boolean equals(java.lang.Object o) { 73 | if (this == o) { 74 | return true; 75 | } 76 | if (o == null || getClass() != o.getClass()) { 77 | return false; 78 | } 79 | RolledUpUnit rolledUpUnit = (RolledUpUnit) o; 80 | return Objects.equals(this.unitType, rolledUpUnit.unitType) && 81 | Objects.equals(this.amount, rolledUpUnit.amount); 82 | } 83 | 84 | @Override 85 | public int hashCode() { 86 | return Objects.hash(unitType, 87 | amount); 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | StringBuilder sb = new StringBuilder(); 93 | sb.append("class RolledUpUnit {\n"); 94 | 95 | sb.append(" unitType: ").append(toIndentedString(unitType)).append("\n"); 96 | sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); 97 | sb.append("}"); 98 | return sb.toString(); 99 | } 100 | 101 | /** 102 | * Convert the given object to string with each line indented by 4 spaces 103 | * (except the first line). 104 | */ 105 | private String toIndentedString(java.lang.Object o) { 106 | if (o == null) { 107 | return "null"; 108 | } 109 | return o.toString().replace("\n", "\n "); 110 | } 111 | } 112 | 113 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Subject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import com.fasterxml.jackson.annotation.JsonProperty; 26 | import org.killbill.billing.client.model.gen.Session; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class Subject { 37 | 38 | private String principal = null; 39 | 40 | private Boolean isAuthenticated = null; 41 | 42 | private Boolean isRemembered = null; 43 | 44 | private Session session = null; 45 | 46 | 47 | public Subject() { 48 | } 49 | 50 | public Subject(final String principal, 51 | final Boolean isAuthenticated, 52 | final Boolean isRemembered, 53 | final Session session) { 54 | this.principal = principal; 55 | this.isAuthenticated = isAuthenticated; 56 | this.isRemembered = isRemembered; 57 | this.session = session; 58 | 59 | } 60 | 61 | 62 | public Subject setPrincipal(final String principal) { 63 | this.principal = principal; 64 | return this; 65 | } 66 | 67 | public String getPrincipal() { 68 | return principal; 69 | } 70 | 71 | public Subject setIsAuthenticated(final Boolean isAuthenticated) { 72 | this.isAuthenticated = isAuthenticated; 73 | return this; 74 | } 75 | 76 | @JsonProperty(value="isAuthenticated") 77 | public Boolean isAuthenticated() { 78 | return isAuthenticated; 79 | } 80 | 81 | public Subject setIsRemembered(final Boolean isRemembered) { 82 | this.isRemembered = isRemembered; 83 | return this; 84 | } 85 | 86 | @JsonProperty(value="isRemembered") 87 | public Boolean isRemembered() { 88 | return isRemembered; 89 | } 90 | 91 | public Subject setSession(final Session session) { 92 | this.session = session; 93 | return this; 94 | } 95 | 96 | public Session getSession() { 97 | return session; 98 | } 99 | 100 | @Override 101 | public boolean equals(java.lang.Object o) { 102 | if (this == o) { 103 | return true; 104 | } 105 | if (o == null || getClass() != o.getClass()) { 106 | return false; 107 | } 108 | Subject subject = (Subject) o; 109 | return Objects.equals(this.principal, subject.principal) && 110 | Objects.equals(this.isAuthenticated, subject.isAuthenticated) && 111 | Objects.equals(this.isRemembered, subject.isRemembered) && 112 | Objects.equals(this.session, subject.session); 113 | } 114 | 115 | @Override 116 | public int hashCode() { 117 | return Objects.hash(principal, 118 | isAuthenticated, 119 | isRemembered, 120 | session); 121 | } 122 | 123 | @Override 124 | public String toString() { 125 | StringBuilder sb = new StringBuilder(); 126 | sb.append("class Subject {\n"); 127 | 128 | sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); 129 | sb.append(" isAuthenticated: ").append(toIndentedString(isAuthenticated)).append("\n"); 130 | sb.append(" isRemembered: ").append(toIndentedString(isRemembered)).append("\n"); 131 | sb.append(" session: ").append(toIndentedString(session)).append("\n"); 132 | sb.append("}"); 133 | return sb.toString(); 134 | } 135 | 136 | /** 137 | * Convert the given object to string with each line indented by 4 spaces 138 | * (except the first line). 139 | */ 140 | private String toIndentedString(java.lang.Object o) { 141 | if (o == null) { 142 | return "null"; 143 | } 144 | return o.toString().replace("\n", "\n "); 145 | } 146 | } 147 | 148 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/SubscriptionUsageRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import java.util.UUID; 28 | import org.killbill.billing.client.model.gen.UnitUsageRecord; 29 | 30 | /** 31 | * DO NOT EDIT !!! 32 | * 33 | * This code has been generated by the Kill Bill swagger generator. 34 | * @See https://github.com/killbill/killbill-swagger-coden 35 | */ 36 | import org.killbill.billing.client.model.KillBillObject; 37 | 38 | public class SubscriptionUsageRecord { 39 | 40 | private UUID subscriptionId = null; 41 | 42 | private String trackingId = null; 43 | 44 | private List unitUsageRecords = new ArrayList(); 45 | 46 | 47 | public SubscriptionUsageRecord() { 48 | } 49 | 50 | public SubscriptionUsageRecord(final UUID subscriptionId, 51 | final String trackingId, 52 | final List unitUsageRecords) { 53 | this.subscriptionId = subscriptionId; 54 | this.trackingId = trackingId; 55 | this.unitUsageRecords = unitUsageRecords; 56 | 57 | } 58 | 59 | 60 | public SubscriptionUsageRecord setSubscriptionId(final UUID subscriptionId) { 61 | this.subscriptionId = subscriptionId; 62 | return this; 63 | } 64 | 65 | public UUID getSubscriptionId() { 66 | return subscriptionId; 67 | } 68 | 69 | public SubscriptionUsageRecord setTrackingId(final String trackingId) { 70 | this.trackingId = trackingId; 71 | return this; 72 | } 73 | 74 | public String getTrackingId() { 75 | return trackingId; 76 | } 77 | 78 | public SubscriptionUsageRecord setUnitUsageRecords(final List unitUsageRecords) { 79 | this.unitUsageRecords = unitUsageRecords; 80 | return this; 81 | } 82 | 83 | public SubscriptionUsageRecord addUnitUsageRecordsItem(final UnitUsageRecord unitUsageRecordsItem) { 84 | this.unitUsageRecords.add(unitUsageRecordsItem); 85 | return this; 86 | } 87 | 88 | public List getUnitUsageRecords() { 89 | return unitUsageRecords; 90 | } 91 | 92 | @Override 93 | public boolean equals(java.lang.Object o) { 94 | if (this == o) { 95 | return true; 96 | } 97 | if (o == null || getClass() != o.getClass()) { 98 | return false; 99 | } 100 | SubscriptionUsageRecord subscriptionUsageRecord = (SubscriptionUsageRecord) o; 101 | return Objects.equals(this.subscriptionId, subscriptionUsageRecord.subscriptionId) && 102 | Objects.equals(this.trackingId, subscriptionUsageRecord.trackingId) && 103 | Objects.equals(this.unitUsageRecords, subscriptionUsageRecord.unitUsageRecords); 104 | } 105 | 106 | @Override 107 | public int hashCode() { 108 | return Objects.hash(subscriptionId, 109 | trackingId, 110 | unitUsageRecords); 111 | } 112 | 113 | @Override 114 | public String toString() { 115 | StringBuilder sb = new StringBuilder(); 116 | sb.append("class SubscriptionUsageRecord {\n"); 117 | 118 | sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); 119 | sb.append(" trackingId: ").append(toIndentedString(trackingId)).append("\n"); 120 | sb.append(" unitUsageRecords: ").append(toIndentedString(unitUsageRecords)).append("\n"); 121 | sb.append("}"); 122 | return sb.toString(); 123 | } 124 | 125 | /** 126 | * Convert the given object to string with each line indented by 4 spaces 127 | * (except the first line). 128 | */ 129 | private String toIndentedString(java.lang.Object o) { 130 | if (o == null) { 131 | return "null"; 132 | } 133 | return o.toString().replace("\n", "\n "); 134 | } 135 | } 136 | 137 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/TenantKeyValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.AuditLog; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class TenantKeyValue extends KillBillObject { 38 | 39 | private String key = null; 40 | 41 | private List values = null; 42 | 43 | 44 | 45 | public TenantKeyValue() { 46 | } 47 | 48 | public TenantKeyValue(final String key, 49 | final List values, 50 | final List auditLogs) { 51 | super(auditLogs); 52 | this.key = key; 53 | this.values = values; 54 | 55 | } 56 | 57 | 58 | public TenantKeyValue setKey(final String key) { 59 | this.key = key; 60 | return this; 61 | } 62 | 63 | public String getKey() { 64 | return key; 65 | } 66 | 67 | public TenantKeyValue setValues(final List values) { 68 | this.values = values; 69 | return this; 70 | } 71 | 72 | public TenantKeyValue addValuesItem(final String valuesItem) { 73 | if (this.values == null) { 74 | this.values = new ArrayList(); 75 | } 76 | this.values.add(valuesItem); 77 | return this; 78 | } 79 | 80 | public List getValues() { 81 | return values; 82 | } 83 | 84 | @Override 85 | public boolean equals(java.lang.Object o) { 86 | if (this == o) { 87 | return true; 88 | } 89 | if (o == null || getClass() != o.getClass()) { 90 | return false; 91 | } 92 | TenantKeyValue tenantKeyValue = (TenantKeyValue) o; 93 | return Objects.equals(this.key, tenantKeyValue.key) && 94 | Objects.equals(this.values, tenantKeyValue.values) && 95 | true /* ignoring this.auditLogs for identity operations */; 96 | } 97 | 98 | @Override 99 | public int hashCode() { 100 | return Objects.hash(key, 101 | values, 102 | 0 /* ignoring auditLogs for identity operations */ ); 103 | } 104 | 105 | @Override 106 | public String toString() { 107 | StringBuilder sb = new StringBuilder(); 108 | sb.append("class TenantKeyValue {\n"); 109 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 110 | sb.append(" key: ").append(toIndentedString(key)).append("\n"); 111 | sb.append(" values: ").append(toIndentedString(values)).append("\n"); 112 | sb.append(" auditLogs: ").append(toIndentedString(auditLogs)).append("\n"); 113 | sb.append("}"); 114 | return sb.toString(); 115 | } 116 | 117 | /** 118 | * Convert the given object to string with each line indented by 4 spaces 119 | * (except the first line). 120 | */ 121 | private String toIndentedString(java.lang.Object o) { 122 | if (o == null) { 123 | return "null"; 124 | } 125 | return o.toString().replace("\n", "\n "); 126 | } 127 | } 128 | 129 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/TierPrice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.BlockPrice; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class TierPrice { 38 | 39 | private List blockPrices = null; 40 | 41 | 42 | public TierPrice() { 43 | } 44 | 45 | public TierPrice(final List blockPrices) { 46 | this.blockPrices = blockPrices; 47 | 48 | } 49 | 50 | 51 | public TierPrice setBlockPrices(final List blockPrices) { 52 | this.blockPrices = blockPrices; 53 | return this; 54 | } 55 | 56 | public TierPrice addBlockPricesItem(final BlockPrice blockPricesItem) { 57 | if (this.blockPrices == null) { 58 | this.blockPrices = new ArrayList(); 59 | } 60 | this.blockPrices.add(blockPricesItem); 61 | return this; 62 | } 63 | 64 | public List getBlockPrices() { 65 | return blockPrices; 66 | } 67 | 68 | @Override 69 | public boolean equals(java.lang.Object o) { 70 | if (this == o) { 71 | return true; 72 | } 73 | if (o == null || getClass() != o.getClass()) { 74 | return false; 75 | } 76 | TierPrice tierPrice = (TierPrice) o; 77 | return Objects.equals(this.blockPrices, tierPrice.blockPrices); 78 | } 79 | 80 | @Override 81 | public int hashCode() { 82 | return Objects.hash(blockPrices); 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | StringBuilder sb = new StringBuilder(); 88 | sb.append("class TierPrice {\n"); 89 | 90 | sb.append(" blockPrices: ").append(toIndentedString(blockPrices)).append("\n"); 91 | sb.append("}"); 92 | return sb.toString(); 93 | } 94 | 95 | /** 96 | * Convert the given object to string with each line indented by 4 spaces 97 | * (except the first line). 98 | */ 99 | private String toIndentedString(java.lang.Object o) { 100 | if (o == null) { 101 | return "null"; 102 | } 103 | return o.toString().replace("\n", "\n "); 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/TieredBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.Price; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class TieredBlock { 38 | 39 | private String unit = null; 40 | 41 | private String size = null; 42 | 43 | private String max = null; 44 | 45 | private List prices = null; 46 | 47 | 48 | public TieredBlock() { 49 | } 50 | 51 | public TieredBlock(final String unit, 52 | final String size, 53 | final String max, 54 | final List prices) { 55 | this.unit = unit; 56 | this.size = size; 57 | this.max = max; 58 | this.prices = prices; 59 | 60 | } 61 | 62 | 63 | public TieredBlock setUnit(final String unit) { 64 | this.unit = unit; 65 | return this; 66 | } 67 | 68 | public String getUnit() { 69 | return unit; 70 | } 71 | 72 | public TieredBlock setSize(final String size) { 73 | this.size = size; 74 | return this; 75 | } 76 | 77 | public String getSize() { 78 | return size; 79 | } 80 | 81 | public TieredBlock setMax(final String max) { 82 | this.max = max; 83 | return this; 84 | } 85 | 86 | public String getMax() { 87 | return max; 88 | } 89 | 90 | public TieredBlock setPrices(final List prices) { 91 | this.prices = prices; 92 | return this; 93 | } 94 | 95 | public TieredBlock addPricesItem(final Price pricesItem) { 96 | if (this.prices == null) { 97 | this.prices = new ArrayList(); 98 | } 99 | this.prices.add(pricesItem); 100 | return this; 101 | } 102 | 103 | public List getPrices() { 104 | return prices; 105 | } 106 | 107 | @Override 108 | public boolean equals(java.lang.Object o) { 109 | if (this == o) { 110 | return true; 111 | } 112 | if (o == null || getClass() != o.getClass()) { 113 | return false; 114 | } 115 | TieredBlock tieredBlock = (TieredBlock) o; 116 | return Objects.equals(this.unit, tieredBlock.unit) && 117 | Objects.equals(this.size, tieredBlock.size) && 118 | Objects.equals(this.max, tieredBlock.max) && 119 | Objects.equals(this.prices, tieredBlock.prices); 120 | } 121 | 122 | @Override 123 | public int hashCode() { 124 | return Objects.hash(unit, 125 | size, 126 | max, 127 | prices); 128 | } 129 | 130 | @Override 131 | public String toString() { 132 | StringBuilder sb = new StringBuilder(); 133 | sb.append("class TieredBlock {\n"); 134 | 135 | sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); 136 | sb.append(" size: ").append(toIndentedString(size)).append("\n"); 137 | sb.append(" max: ").append(toIndentedString(max)).append("\n"); 138 | sb.append(" prices: ").append(toIndentedString(prices)).append("\n"); 139 | sb.append("}"); 140 | return sb.toString(); 141 | } 142 | 143 | /** 144 | * Convert the given object to string with each line indented by 4 spaces 145 | * (except the first line). 146 | */ 147 | private String toIndentedString(java.lang.Object o) { 148 | if (o == null) { 149 | return "null"; 150 | } 151 | return o.toString().replace("\n", "\n "); 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Unit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | 26 | /** 27 | * DO NOT EDIT !!! 28 | * 29 | * This code has been generated by the Kill Bill swagger generator. 30 | * @See https://github.com/killbill/killbill-swagger-coden 31 | */ 32 | import org.killbill.billing.client.model.KillBillObject; 33 | 34 | public class Unit { 35 | 36 | private String name = null; 37 | 38 | private String prettyName = null; 39 | 40 | 41 | public Unit() { 42 | } 43 | 44 | public Unit(final String name, 45 | final String prettyName) { 46 | this.name = name; 47 | this.prettyName = prettyName; 48 | 49 | } 50 | 51 | 52 | public Unit setName(final String name) { 53 | this.name = name; 54 | return this; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public Unit setPrettyName(final String prettyName) { 62 | this.prettyName = prettyName; 63 | return this; 64 | } 65 | 66 | public String getPrettyName() { 67 | return prettyName; 68 | } 69 | 70 | @Override 71 | public boolean equals(java.lang.Object o) { 72 | if (this == o) { 73 | return true; 74 | } 75 | if (o == null || getClass() != o.getClass()) { 76 | return false; 77 | } 78 | Unit unit = (Unit) o; 79 | return Objects.equals(this.name, unit.name) && 80 | Objects.equals(this.prettyName, unit.prettyName); 81 | } 82 | 83 | @Override 84 | public int hashCode() { 85 | return Objects.hash(name, 86 | prettyName); 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | StringBuilder sb = new StringBuilder(); 92 | sb.append("class Unit {\n"); 93 | 94 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 95 | sb.append(" prettyName: ").append(toIndentedString(prettyName)).append("\n"); 96 | sb.append("}"); 97 | return sb.toString(); 98 | } 99 | 100 | /** 101 | * Convert the given object to string with each line indented by 4 spaces 102 | * (except the first line). 103 | */ 104 | private String toIndentedString(java.lang.Object o) { 105 | if (o == null) { 106 | return "null"; 107 | } 108 | return o.toString().replace("\n", "\n "); 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/UnitUsageRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.UsageRecord; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class UnitUsageRecord { 38 | 39 | private String unitType = null; 40 | 41 | private List usageRecords = null; 42 | 43 | 44 | public UnitUsageRecord() { 45 | } 46 | 47 | public UnitUsageRecord(final String unitType, 48 | final List usageRecords) { 49 | this.unitType = unitType; 50 | this.usageRecords = usageRecords; 51 | 52 | } 53 | 54 | 55 | public UnitUsageRecord setUnitType(final String unitType) { 56 | this.unitType = unitType; 57 | return this; 58 | } 59 | 60 | public String getUnitType() { 61 | return unitType; 62 | } 63 | 64 | public UnitUsageRecord setUsageRecords(final List usageRecords) { 65 | this.usageRecords = usageRecords; 66 | return this; 67 | } 68 | 69 | public UnitUsageRecord addUsageRecordsItem(final UsageRecord usageRecordsItem) { 70 | if (this.usageRecords == null) { 71 | this.usageRecords = new ArrayList(); 72 | } 73 | this.usageRecords.add(usageRecordsItem); 74 | return this; 75 | } 76 | 77 | public List getUsageRecords() { 78 | return usageRecords; 79 | } 80 | 81 | @Override 82 | public boolean equals(java.lang.Object o) { 83 | if (this == o) { 84 | return true; 85 | } 86 | if (o == null || getClass() != o.getClass()) { 87 | return false; 88 | } 89 | UnitUsageRecord unitUsageRecord = (UnitUsageRecord) o; 90 | return Objects.equals(this.unitType, unitUsageRecord.unitType) && 91 | Objects.equals(this.usageRecords, unitUsageRecord.usageRecords); 92 | } 93 | 94 | @Override 95 | public int hashCode() { 96 | return Objects.hash(unitType, 97 | usageRecords); 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | StringBuilder sb = new StringBuilder(); 103 | sb.append("class UnitUsageRecord {\n"); 104 | 105 | sb.append(" unitType: ").append(toIndentedString(unitType)).append("\n"); 106 | sb.append(" usageRecords: ").append(toIndentedString(usageRecords)).append("\n"); 107 | sb.append("}"); 108 | return sb.toString(); 109 | } 110 | 111 | /** 112 | * Convert the given object to string with each line indented by 4 spaces 113 | * (except the first line). 114 | */ 115 | private String toIndentedString(java.lang.Object o) { 116 | if (o == null) { 117 | return "null"; 118 | } 119 | return o.toString().replace("\n", "\n "); 120 | } 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/Usage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import org.killbill.billing.client.model.gen.Tier; 28 | 29 | /** 30 | * DO NOT EDIT !!! 31 | * 32 | * This code has been generated by the Kill Bill swagger generator. 33 | * @See https://github.com/killbill/killbill-swagger-coden 34 | */ 35 | import org.killbill.billing.client.model.KillBillObject; 36 | 37 | public class Usage { 38 | 39 | private String billingPeriod = null; 40 | 41 | private List tiers = null; 42 | 43 | 44 | public Usage() { 45 | } 46 | 47 | public Usage(final String billingPeriod, 48 | final List tiers) { 49 | this.billingPeriod = billingPeriod; 50 | this.tiers = tiers; 51 | 52 | } 53 | 54 | 55 | public Usage setBillingPeriod(final String billingPeriod) { 56 | this.billingPeriod = billingPeriod; 57 | return this; 58 | } 59 | 60 | public String getBillingPeriod() { 61 | return billingPeriod; 62 | } 63 | 64 | public Usage setTiers(final List tiers) { 65 | this.tiers = tiers; 66 | return this; 67 | } 68 | 69 | public Usage addTiersItem(final Tier tiersItem) { 70 | if (this.tiers == null) { 71 | this.tiers = new ArrayList(); 72 | } 73 | this.tiers.add(tiersItem); 74 | return this; 75 | } 76 | 77 | public List getTiers() { 78 | return tiers; 79 | } 80 | 81 | @Override 82 | public boolean equals(java.lang.Object o) { 83 | if (this == o) { 84 | return true; 85 | } 86 | if (o == null || getClass() != o.getClass()) { 87 | return false; 88 | } 89 | Usage usage = (Usage) o; 90 | return Objects.equals(this.billingPeriod, usage.billingPeriod) && 91 | Objects.equals(this.tiers, usage.tiers); 92 | } 93 | 94 | @Override 95 | public int hashCode() { 96 | return Objects.hash(billingPeriod, 97 | tiers); 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | StringBuilder sb = new StringBuilder(); 103 | sb.append("class Usage {\n"); 104 | 105 | sb.append(" billingPeriod: ").append(toIndentedString(billingPeriod)).append("\n"); 106 | sb.append(" tiers: ").append(toIndentedString(tiers)).append("\n"); 107 | sb.append("}"); 108 | return sb.toString(); 109 | } 110 | 111 | /** 112 | * Convert the given object to string with each line indented by 4 spaces 113 | * (except the first line). 114 | */ 115 | private String toIndentedString(java.lang.Object o) { 116 | if (o == null) { 117 | return "null"; 118 | } 119 | return o.toString().replace("\n", "\n "); 120 | } 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/UsageRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.math.BigDecimal; 26 | import org.joda.time.DateTime; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class UsageRecord { 37 | 38 | private DateTime recordDate = null; 39 | 40 | private BigDecimal amount = null; 41 | 42 | 43 | public UsageRecord() { 44 | } 45 | 46 | public UsageRecord(final DateTime recordDate, 47 | final BigDecimal amount) { 48 | this.recordDate = recordDate; 49 | this.amount = amount; 50 | 51 | } 52 | 53 | 54 | public UsageRecord setRecordDate(final DateTime recordDate) { 55 | this.recordDate = recordDate; 56 | return this; 57 | } 58 | 59 | public DateTime getRecordDate() { 60 | return recordDate; 61 | } 62 | 63 | public UsageRecord setAmount(final BigDecimal amount) { 64 | this.amount = amount; 65 | return this; 66 | } 67 | 68 | public BigDecimal getAmount() { 69 | return amount; 70 | } 71 | 72 | @Override 73 | public boolean equals(java.lang.Object o) { 74 | if (this == o) { 75 | return true; 76 | } 77 | if (o == null || getClass() != o.getClass()) { 78 | return false; 79 | } 80 | UsageRecord usageRecord = (UsageRecord) o; 81 | return Objects.equals(this.recordDate, usageRecord.recordDate) && 82 | Objects.equals(this.amount, usageRecord.amount); 83 | } 84 | 85 | @Override 86 | public int hashCode() { 87 | return Objects.hash(recordDate, 88 | amount); 89 | } 90 | 91 | @Override 92 | public String toString() { 93 | StringBuilder sb = new StringBuilder(); 94 | sb.append("class UsageRecord {\n"); 95 | 96 | sb.append(" recordDate: ").append(toIndentedString(recordDate)).append("\n"); 97 | sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); 98 | sb.append("}"); 99 | return sb.toString(); 100 | } 101 | 102 | /** 103 | * Convert the given object to string with each line indented by 4 spaces 104 | * (except the first line). 105 | */ 106 | private String toIndentedString(java.lang.Object o) { 107 | if (o == null) { 108 | return "null"; 109 | } 110 | return o.toString().replace("\n", "\n "); 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/model/gen/UserRoles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2014 Ning, Inc. 3 | * Copyright 2014-2020 Groupon, Inc 4 | * Copyright 2020-2021 Equinix, Inc 5 | * Copyright 2014-2021 The Billing Project, LLC 6 | * 7 | * The Billing Project licenses this file to you under the Apache License, version 2.0 8 | * (the "License"); you may not use this file except in compliance with the 9 | * License. You may obtain a copy of the License at: 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | * License for the specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | package org.killbill.billing.client.model.gen; 22 | 23 | import java.util.Objects; 24 | import java.util.Arrays; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * DO NOT EDIT !!! 30 | * 31 | * This code has been generated by the Kill Bill swagger generator. 32 | * @See https://github.com/killbill/killbill-swagger-coden 33 | */ 34 | import org.killbill.billing.client.model.KillBillObject; 35 | 36 | public class UserRoles { 37 | 38 | private String username = null; 39 | 40 | private String password = null; 41 | 42 | private List roles = new ArrayList(); 43 | 44 | 45 | public UserRoles() { 46 | } 47 | 48 | public UserRoles(final String username, 49 | final String password, 50 | final List roles) { 51 | this.username = username; 52 | this.password = password; 53 | this.roles = roles; 54 | 55 | } 56 | 57 | 58 | public UserRoles setUsername(final String username) { 59 | this.username = username; 60 | return this; 61 | } 62 | 63 | public String getUsername() { 64 | return username; 65 | } 66 | 67 | public UserRoles setPassword(final String password) { 68 | this.password = password; 69 | return this; 70 | } 71 | 72 | public String getPassword() { 73 | return password; 74 | } 75 | 76 | public UserRoles setRoles(final List roles) { 77 | this.roles = roles; 78 | return this; 79 | } 80 | 81 | public UserRoles addRolesItem(final String rolesItem) { 82 | this.roles.add(rolesItem); 83 | return this; 84 | } 85 | 86 | public List getRoles() { 87 | return roles; 88 | } 89 | 90 | @Override 91 | public boolean equals(java.lang.Object o) { 92 | if (this == o) { 93 | return true; 94 | } 95 | if (o == null || getClass() != o.getClass()) { 96 | return false; 97 | } 98 | UserRoles userRoles = (UserRoles) o; 99 | return Objects.equals(this.username, userRoles.username) && 100 | Objects.equals(this.password, userRoles.password) && 101 | Objects.equals(this.roles, userRoles.roles); 102 | } 103 | 104 | @Override 105 | public int hashCode() { 106 | return Objects.hash(username, 107 | password, 108 | roles); 109 | } 110 | 111 | @Override 112 | public String toString() { 113 | StringBuilder sb = new StringBuilder(); 114 | sb.append("class UserRoles {\n"); 115 | 116 | sb.append(" username: ").append(toIndentedString(username)).append("\n"); 117 | sb.append(" password: ").append(toIndentedString(password)).append("\n"); 118 | sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); 119 | sb.append("}"); 120 | return sb.toString(); 121 | } 122 | 123 | /** 124 | * Convert the given object to string with each line indented by 4 spaces 125 | * (except the first line). 126 | */ 127 | private String toIndentedString(java.lang.Object o) { 128 | if (o == null) { 129 | return "null"; 130 | } 131 | return o.toString().replace("\n", "\n "); 132 | } 133 | } 134 | 135 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/util/Multimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.util; 19 | 20 | import java.util.Collection; 21 | import java.util.Map; 22 | 23 | /** 24 | * Subset of Guava's {@code Multimap}. 25 | */ 26 | public interface Multimap { 27 | 28 | void put(K key, V value); 29 | 30 | void putAll(K key, Collection values); 31 | 32 | void remove(K key); 33 | 34 | Map> asMap(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/util/Preconditions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.util; 19 | 20 | public final class Preconditions { 21 | 22 | public static T checkNotNull(final T reference, final Object errorMessage) { 23 | if (reference == null) { 24 | throw new NullPointerException(String.valueOf(errorMessage)); 25 | } 26 | return reference; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/killbill/billing/client/util/TreeMapSetMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.util; 19 | 20 | import java.util.Collection; 21 | import java.util.Map; 22 | import java.util.SortedMap; 23 | import java.util.TreeMap; 24 | import java.util.TreeSet; 25 | 26 | /** 27 | *

Implementation of {@link Multimap}:

28 | *
    29 | *
  • backed by {@link SortedMap} and use {@link TreeSet} as a values
  • 30 | *
  • key cannot be {@code null}
  • 31 | *
  • values cannot be {@code null}
  • 32 | *
  • {@link #asMap()} return backed map (the {@code SortedMap}).
  • 33 | *
34 | */ 35 | public class TreeMapSetMultimap implements Multimap { 36 | 37 | private final SortedMap> delegate = new TreeMap<>(); 38 | 39 | public TreeMapSetMultimap() { 40 | } 41 | 42 | public TreeMapSetMultimap(final Map> map) { 43 | if (map != null && !map.isEmpty()) { 44 | delegate.putAll(map); 45 | } 46 | } 47 | 48 | @Override 49 | public void put(final K key, final V value) { 50 | Preconditions.checkNotNull(key, "Cannot #put() with null key"); 51 | Preconditions.checkNotNull(value, "Cannot #put() with null value"); 52 | 53 | if (delegate.containsKey(key)) { 54 | delegate.get(key).add(value); 55 | } else { 56 | final Collection list = new TreeSet<>(); 57 | list.add(value); 58 | delegate.put(key, list); 59 | } 60 | } 61 | 62 | @Override 63 | public void putAll(final K key, final Collection values) { 64 | Preconditions.checkNotNull(key, "Cannot #putAll() with null key"); 65 | Preconditions.checkNotNull(values, "Cannot #putAll() with null values"); 66 | 67 | if (!values.isEmpty()) { 68 | if (delegate.containsKey(key)) { 69 | delegate.get(key).addAll(values); 70 | } else { 71 | delegate.put(key, new TreeSet<>(values)); 72 | } 73 | } 74 | } 75 | 76 | @Override 77 | public void remove(final K key) { 78 | Preconditions.checkNotNull(key, "Cannot #remove() with null key"); 79 | delegate.remove(key); 80 | } 81 | 82 | @Override 83 | public Map> asMap() { 84 | return delegate; 85 | } 86 | 87 | @Override 88 | public String toString() { 89 | return "TreeMapSetMultimap {" + delegate + '}'; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/test/java/org/killbill/billing/client/TestRequestOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client; 19 | 20 | import java.util.ArrayList; 21 | import java.util.Collection; 22 | import java.util.HashMap; 23 | import java.util.List; 24 | import java.util.Map; 25 | 26 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 27 | import org.killbill.billing.client.util.Multimap; 28 | import org.killbill.billing.client.util.TreeMapSetMultimap; 29 | import org.testng.Assert; 30 | import org.testng.annotations.Test; 31 | 32 | public class TestRequestOptions { 33 | 34 | @Test(groups = "fast") 35 | public void test() { 36 | // requestOptionsWithImmutableMapValues(); 37 | requestOptionsWithMutableMapValues(); 38 | } 39 | 40 | void requestOptionsWithImmutableMapValues() { 41 | // Let's consider scenario a user using the java client: 42 | final Map> queryParams = new HashMap<>(); 43 | // User can generously do this ... 44 | queryParams.put("key1", new ArrayList<>(List.of("1.1", "1.2", "1.3"))); 45 | // .... or accidentally do this (because after guava removed, this is the "straight forward" approach) 46 | queryParams.put("key2", List.of("2.1", "2.2", "2.3")); 47 | // So far, good. 48 | final RequestOptions requestOptions = new RequestOptionsBuilder() 49 | .withQueryParams(queryParams) 50 | .build(); 51 | 52 | // .... Then our internal generated API classes have something like this: (eg: InvoiceApi) 53 | // (Also note that as per '34b59c4c' commit, InvoiceApi still use internal #addToMapValues() method, which is do the same thing) 54 | final Multimap queryParamsInApi = new TreeMapSetMultimap<>(requestOptions.getQueryParams()); 55 | 56 | // This one Ok, because user pass mutable object (wrap List.of() to new ArrayList) 57 | queryParamsInApi.put("key1", "1.4"); 58 | try { 59 | // This one not Ok, because user pass immutable object first (only use List.of() ) 60 | queryParamsInApi.put("key2", "2.4"); 61 | Assert.fail("Make sure that RequestOptionBuilder#withQueryParams NOT calling toMutableMapValues() method"); 62 | } catch (final UnsupportedOperationException ignored) { 63 | } 64 | } 65 | 66 | // Simulating the same thing as "requestOptionsWithImmutableMapValues()", but expect that 67 | // RequestOptions#withQueryParams() call Req method. 68 | 69 | /** 70 | * Simulating the same thing as {@link #requestOptionsWithImmutableMapValues()}, but expect that 71 | */ 72 | private void requestOptionsWithMutableMapValues() { 73 | final Map> queryParams = new HashMap<>(); 74 | queryParams.put("key1", new ArrayList<>(List.of("1.1", "1.2", "1.3"))); 75 | queryParams.put("key2", List.of("2.1", "2.2", "2.3")); 76 | 77 | final RequestOptions requestOptions = new RequestOptionsBuilder() 78 | .withQueryParams(queryParams) 79 | .build(); 80 | 81 | final Multimap queryParamsInApi = new TreeMapSetMultimap<>(requestOptions.getQueryParams()); 82 | 83 | queryParamsInApi.put("key1", "1.4"); 84 | queryParamsInApi.put("key2", "2.4"); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/test/java/org/killbill/billing/client/api/gen/TestInvoiceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.api.gen; 19 | 20 | import java.util.UUID; 21 | 22 | import org.killbill.billing.client.KillBillClientException; 23 | import org.killbill.billing.client.KillBillHttpClient; 24 | import org.killbill.billing.client.RequestOptions; 25 | import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder; 26 | import org.killbill.billing.client.util.Multimap; 27 | import org.killbill.billing.client.util.TreeMapSetMultimap; 28 | import org.mockito.Mockito; 29 | import org.testng.annotations.Test; 30 | 31 | public class TestInvoiceApi { 32 | 33 | // make sure that withQueryParams() will not throw the same problem as before 34 | // adding RequestOptionsBuilder#toMutableMapValues() 35 | @Test(groups = "fast") 36 | public void getPaymentsForInvoice() throws KillBillClientException { 37 | final KillBillHttpClient httpClient = Mockito.mock(KillBillHttpClient.class); 38 | 39 | final Multimap queryParams = new TreeMapSetMultimap<>(); 40 | queryParams.put("key1", "value1"); 41 | 42 | final RequestOptions requestOptions = new RequestOptionsBuilder() 43 | .withQueryParams(queryParams.asMap()) 44 | .build(); 45 | 46 | final InvoiceApi api = new InvoiceApi(httpClient); 47 | api.getPaymentsForInvoice(UUID.randomUUID(), requestOptions); 48 | 49 | Mockito.verify(httpClient, Mockito.times(1)).doGet(Mockito.anyString(), (Class) Mockito.any(), Mockito.any()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/killbill/billing/client/util/TestTreeMapSetMultimap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 Equinix, Inc 3 | * Copyright 2014-2022 The Billing Project, LLC 4 | * 5 | * The Billing Project licenses this file to you under the Apache License, version 2.0 6 | * (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at: 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package org.killbill.billing.client.util; 19 | 20 | import java.util.Collection; 21 | import java.util.Collections; 22 | import java.util.List; 23 | import java.util.Map; 24 | import java.util.Set; 25 | 26 | import org.testng.Assert; 27 | import org.testng.annotations.Test; 28 | 29 | public class TestTreeMapSetMultimap { 30 | 31 | @Test(groups = "fast") 32 | public void put() { 33 | final Multimap multimap = new TreeMapSetMultimap<>(); 34 | multimap.put("key", "value"); 35 | Assert.assertEquals(multimap.asMap().size(), 1); 36 | Assert.assertTrue(multimap.asMap().keySet().stream().allMatch("key"::equals)); 37 | Assert.assertTrue(multimap.asMap().values().stream().allMatch(values -> values.contains("value"))); 38 | 39 | try { 40 | multimap.put(null, "any"); 41 | Assert.fail("Null key should not supported"); 42 | } catch (final NullPointerException ignored) { 43 | } 44 | 45 | try { 46 | multimap.put(null, "any"); 47 | Assert.fail("Null values should not supported"); 48 | } catch (final NullPointerException ignored) { 49 | } 50 | } 51 | 52 | @Test(groups = "fast") 53 | public void putAll() { 54 | final Multimap multimap = new TreeMapSetMultimap<>(); 55 | multimap.putAll("key1", List.of("1.1", "1.2", "1.3")); 56 | 57 | Assert.assertTrue(multimap.asMap().keySet().stream().allMatch("key1"::equals)); 58 | Assert.assertTrue(multimap.asMap().values().stream().allMatch(values -> values.containsAll(List.of("1.1", "1.2", "1.3")))); 59 | 60 | // No matter what user supplied in values, it should be able to put more. 61 | multimap.put("key1", "1.4"); 62 | multimap.putAll("key1", Collections.singleton("1.5")); 63 | multimap.putAll("key1", Set.of("1.5", "1.6")); // 1.5 purposely duplicated. 64 | multimap.putAll("key2", List.of("2.1", "2.2")); 65 | multimap.putAll("key1", Collections.emptyList()); 66 | 67 | Assert.assertEquals(multimap.asMap().get("key1").size(), 6); 68 | Assert.assertTrue(multimap.asMap().get("key1").containsAll(List.of("1.1", "1.2", "1.3", "1.4", "1.5", "1.6"))); 69 | } 70 | 71 | @Test 72 | public void remove() { 73 | final Multimap multimap = new TreeMapSetMultimap<>(); 74 | multimap.put("key1", "val1"); 75 | multimap.put("key2", "val2"); 76 | 77 | Assert.assertEquals(multimap.asMap().size(), 2); 78 | 79 | multimap.remove("key1"); 80 | 81 | Assert.assertEquals(multimap.asMap().size(), 1); 82 | } 83 | 84 | @Test(groups = "fast") 85 | public void asMap() { 86 | final Multimap multimap = new TreeMapSetMultimap<>(); 87 | multimap.putAll("key1", List.of("1.1", "1.2", "1.3")); 88 | 89 | final Map> asMap = multimap.asMap(); 90 | 91 | Assert.assertEquals(asMap.size(), 1); 92 | Assert.assertEquals(asMap.get("key1").size(), 3); 93 | 94 | multimap.put("key1", "1.4"); 95 | multimap.putAll("key1", List.of("1.5", "1.6")); 96 | multimap.put("key2", "2.1"); 97 | 98 | Assert.assertEquals(asMap.get("key2"), List.of("2.1")); 99 | Assert.assertEquals(asMap.size(), 2); 100 | Assert.assertEquals(asMap.get("key1").size(), 6); 101 | } 102 | } 103 | --------------------------------------------------------------------------------