Skip to content
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

- adds a vararg support for build request in java templates #292

Merged
merged 4 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ import <#=importNamespace#>.core.IBaseClient;
super(requestUrl, client, requestOptions);
}

public <#=c.ITypeCollectionReferenceRequest()#> buildRequest() {
return buildRequest(getOptions());
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionReferenceRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionReferenceRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions) {
return new <#=c.TypeCollectionReferenceRequest()#>(getRequestUrl(), getClient(), requestOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,22 @@ import <#=importNamespace#>.core.IBaseClient;
super(requestUrl, client, requestOptions);
}

public <#=c.ITypeCollectionRequest()#> buildRequest() {
return buildRequest(getOptions());
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions) {
return new <#=c.TypeCollectionRequest()#>(getRequestUrl(), getClient(), requestOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ import <#=importNamespace#>.core.IBaseClient;
super(requestUrl, client, requestOptions);
}

public <#=c.ITypeCollectionWithReferencesRequest()#> buildRequest() {
return buildRequest(getOptions());
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionWithReferencesRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionWithReferencesRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions) {
return new <#=c.TypeCollectionWithReferencesRequest()#>(getRequestUrl(), getClient(), requestOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import <#=importNamespace#>.core.IBaseClient;
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return The <#=c.ITypeReferenceRequest()#> instance
*/
public <#=c.ITypeReferenceRequest()#> buildRequest() {
return buildRequest(getOptions());
public <#=c.ITypeReferenceRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import <#=importNamespace#>.http.BaseRequestBuilder;
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeRequest()#> instance
*/
public <#=c.ITypeRequest()#> buildRequest() {
return buildRequest(getOptions());
public <#=c.ITypeRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import <#=importNamespace#>.http.BaseRequestBuilder;
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeStreamRequest()#> instance
*/
public <#=c.ITypeStreamRequest()#> buildRequest() {
return buildRequest(getOptions());
public <#=c.ITypeStreamRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import <#=importNamespace#>.core.IBaseClient;
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeWithReferencesRequest()#> instance
*/
public <#=c.ITypeWithReferencesRequest()#> buildRequest() {
return buildRequest(getOptions());
public <#=c.ITypeWithReferencesRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,23 @@ import <#=importNamespace#>.core.<#=c.GetMethodRequestBuilderSuperClass() #>;
<# } #>
}
<# } #>

public <#=c.ITypeCollectionRequest()#> buildRequest() {
return buildRequest(getOptions());

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public <#=c.ITypeCollectionRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions) {
<#= c.TypeCollectionRequest()#> request = new <#=c.TypeCollectionRequest()#>(
getRequestUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ import com.google.gson.JsonElement;
/**
* Creates the <#=c.ITypeRequest()#>
*
* @param requestOptions the options for the request
* @return the <#=c.ITypeRequest()#> instance
*/
public <#=c.ITypeRequest()#> buildRequest() {
return buildRequest(getOptions());
public <#=c.ITypeRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@

<#=TypeHelperJava.CreateInterfaceDef(c.ITypeCollectionReferenceRequestBuilder(), "IRequestBuilder")#>

<#=c.ITypeCollectionReferenceRequest()#> buildRequest();

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionReferenceRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionReferenceRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@ import <#=importNamespace#>.http.IBaseCollectionPage;

<#=TypeHelperJava.CreateInterfaceDef(c.ITypeCollectionRequestBuilder(), "IRequestBuilder")#>

<#=c.ITypeCollectionRequest()#> buildRequest();
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions);

<#=c.ITypeRequestBuilder()#> byId(final String id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ import <#=importNamespace#>.http.IHttpRequest;

<#=TypeHelperJava.CreateInterfaceDef(c.ITypeCollectionWithReferencesRequestBuilder(), "IRequestBuilder")#>

<#=c.ITypeCollectionWithReferencesRequest()#> buildRequest();

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionWithReferencesRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionWithReferencesRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions);

<#=c.ITypeWithReferencesRequestBuilder()#> byId(final String id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import <#=mainNamespace#>.<#=c.GetPackagePrefix()#>.<#=c.TypeName()#>;
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeReferenceRequest()#> instance
*/
<#=c.ITypeReferenceRequest()#> buildRequest();
<#=c.ITypeReferenceRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request with specific options instead of the existing options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeRequest()#> instance
*/
<#=c.ITypeRequest()#> buildRequest();
<#=c.ITypeRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request with specific options instead of the existing options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import <#=mainNamespace#>.<#=TypeHelperJava.GetPrefixForRequests()#>.<#=c.ITypeS
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeStreamRequest()#> instance
*/
<#=c.ITypeStreamRequest()#> buildRequest();
<#=c.ITypeStreamRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request with specific options instead of the existing options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the <#=c.ITypeWithReferencesRequest()#> instance
*/
<#=c.ITypeWithReferencesRequest()#> buildRequest();
<#=c.ITypeWithReferencesRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request with specific options instead of the existing options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@ import <#=mainNamespace#>.<#=TypeHelperJava.GetPrefixForRequests()#>.<#=c.ITypeC

<#=TypeHelperJava.CreateInterfaceDef(c.ITypeCollectionRequestBuilder(), "IRequestBuilder")#>

<#=c.ITypeCollectionRequest()#> buildRequest();
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
<#=c.ITypeCollectionRequest()#> buildRequest(final java.util.List<? extends <#=importNamespace#>.options.Option> requestOptions);

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import <#=importNamespace#>.http.IRequestBuilder;
/**
* Creates the <#=c.ITypeRequest()#>
*
* @param requestOptions the options for the request
* @return the <#=c.ITypeRequest()#> instance
*/
<#=c.ITypeRequest()#> buildRequest();
<#=c.ITypeRequest()#> buildRequest(final com.microsoft.graph.options.Option... requestOptions);

/**
* Creates the <#=c.ITypeRequest()#> with specific options instead of the existing options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ public CallCollectionRequestBuilder(final String requestUrl, final IBaseClient c
super(requestUrl, client, requestOptions);
}

public ICallCollectionRequest buildRequest() {
return buildRequest(getOptions());
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public ICallCollectionRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public ICallCollectionRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
return new CallCollectionRequest(getRequestUrl(), getClient(), requestOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ public CallReferenceRequestBuilder(final String requestUrl, final IBaseClient cl
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return The ICallReferenceRequest instance
*/
public ICallReferenceRequest buildRequest() {
return buildRequest(getOptions());
public ICallReferenceRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ public CallRequestBuilder(final String requestUrl, final IBaseClient client, fin
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the ICallRequest instance
*/
public ICallRequest buildRequest() {
return buildRequest(getOptions());
public ICallRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ public CallWithReferenceRequestBuilder(final String requestUrl, final IBaseClien
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the ICallWithReferenceRequest instance
*/
public ICallWithReferenceRequest buildRequest() {
return buildRequest(getOptions());
public ICallWithReferenceRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}

/**
Expand Down
Loading