-
Notifications
You must be signed in to change notification settings - Fork 367
Add non-autogen typed params Event/File/EphemeralKeys #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mickjermsurawong-stripe
merged 6 commits into
integration-v9
from
mickjermsurawong/non-autogen-typed-params
Apr 9, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4c810bb
file create params with handling of file object
mickjermsurawong-stripe 4c503ec
create file with typed params
mickjermsurawong-stripe 62e9679
list file with typed params
mickjermsurawong-stripe a3168fe
add ephemeral key create params
mickjermsurawong-stripe ab881b8
add event list params
mickjermsurawong-stripe e8b7874
null check for typed parameters
mickjermsurawong-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/main/java/com/stripe/param/EphemeralKeyCreateParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.stripe.param; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no change to this file from the generator. But I removed the comment that is generated.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
import com.google.gson.annotations.SerializedName; | ||
import com.stripe.net.ApiRequestParams; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class EphemeralKeyCreateParams extends ApiRequestParams { | ||
/** The ID of the Customer you'd like to modify using the resulting ephemeral key. */ | ||
@SerializedName("customer") | ||
String customer; | ||
|
||
/** Specifies which fields in the response should be expanded. */ | ||
@SerializedName("expand") | ||
List<String> expand; | ||
|
||
/** The ID of the Issuing Card you'd like to access using the resulting ephemeral key. */ | ||
@SerializedName("issuing_card") | ||
String issuingCard; | ||
|
||
private EphemeralKeyCreateParams(String customer, List<String> expand, String issuingCard) { | ||
this.customer = customer; | ||
this.expand = expand; | ||
this.issuingCard = issuingCard; | ||
} | ||
|
||
public static Builder builder() { | ||
return new com.stripe.param.EphemeralKeyCreateParams.Builder(); | ||
} | ||
|
||
public static class Builder { | ||
private String customer; | ||
|
||
private List<String> expand; | ||
|
||
private String issuingCard; | ||
|
||
/** Finalize and obtain parameter instance from this builder. */ | ||
public EphemeralKeyCreateParams build() { | ||
return new EphemeralKeyCreateParams(this.customer, this.expand, this.issuingCard); | ||
} | ||
|
||
/** The ID of the Customer you'd like to modify using the resulting ephemeral key. */ | ||
public Builder setCustomer(String customer) { | ||
this.customer = customer; | ||
return this; | ||
} | ||
|
||
/** | ||
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and | ||
* subsequent calls adds additional elements to the original list. See {@link | ||
* EphemeralKeyCreateParams#expand} for the field documentation. | ||
*/ | ||
public Builder addExpand(String element) { | ||
if (this.expand == null) { | ||
this.expand = new ArrayList<>(); | ||
} | ||
this.expand.add(element); | ||
return this; | ||
} | ||
|
||
/** | ||
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and | ||
* subsequent calls adds additional elements to the original list. See {@link | ||
* EphemeralKeyCreateParams#expand} for the field documentation. | ||
*/ | ||
public Builder addAllExpand(List<String> elements) { | ||
if (this.expand == null) { | ||
this.expand = new ArrayList<>(); | ||
} | ||
this.expand.addAll(elements); | ||
return this; | ||
} | ||
|
||
/** The ID of the Issuing Card you'd like to access using the resulting ephemeral key. */ | ||
public Builder setIssuingCard(String issuingCard) { | ||
this.issuingCard = issuingCard; | ||
return this; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom error message here instead of failing in the next line
toMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice!