Skip to content

feature/java orderby #301

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
merged 4 commits into from
Sep 25, 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 @@ -80,6 +80,19 @@ import <#=mainNamespace#>.<#=c.GetPackagePrefix()#>.<#=c.TypeName()#>;
return (<#=c.TypeCollectionReferenceRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSort) { #>
/**
* Sets the order by clause for the request
*
* @param value the sort clause
* @return the updated request
*/
public <#=c.ITypeCollectionReferenceRequest()#> orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (<#=c.TypeCollectionReferenceRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSelect) { #>
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ import <#=mainNamespace#>.<#=TypeHelperJava.GetPrefixForRequests()#>.<#=c.TypeCo
return (<#=c.TypeCollectionRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSort) { #>
/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
public <#=c.ITypeCollectionRequest()#> orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (<#=c.TypeCollectionRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSelect) { #>
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ import <#=importNamespace#>.concurrency.IExecutors;
return (<#=c.TypeCollectionRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSort) { #>
public <#=c.ITypeCollectionRequest()#> orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (<#=c.TypeCollectionRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSelect) { #>
public <#=c.ITypeCollectionRequest()#> select(final String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ import <#=importNamespace#>.core.IBaseClient;
return (<#=c.TypeReferenceRequest()#>)this;
}
<# } #>
<# if (c.GetFeatures().CanFilter) { #>
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public <#=c.ITypeReferenceRequest()#> filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (<#=c.TypeReferenceRequest()#>)this;
}
<# } #>
<# if (c.GetFeatures().CanUpdate) { #>
/**
* Puts the <#=c.TypeName()#>
Expand Down
13 changes: 0 additions & 13 deletions Templates/Java/requests_extensions/BaseEntityRequest.java.tt
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ import <#=importNamespace#>.http.HttpMethod;
return (<#=c.TypeRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanFilter) { #>
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public <#=c.ITypeRequest()#> filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (<#=c.TypeRequest()#>)this;
}

<# } #>
<# if (c.AsOdcmProperty() != null && c.AsOdcmProperty().IsCollection && c.GetFeatures().CanUseTop) { #>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,4 @@ import <#=importNamespace#>.serializer.IJsonBackedObject;
return (<#=c.TypeWithReferencesRequest()#>)this;
}
<# } #>
<# if (c.GetFeatures().CanFilter) { #>
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public <#=c.ITypeWithReferencesRequest()#> filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (<#=c.TypeWithReferencesRequest()#>)this;
}
<# } #>
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,5 @@ import <#=importNamespace#>.http.HttpMethod;
return (<#=typeRequest#>)this;
}

<# } #>
<# if (c.GetFeatures().CanFilter) { #>
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public <#=iTypeRequest#> filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (<#=typeRequest#>)this;
}

<# } #>
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,18 @@ import <#=importNamespace#>.concurrency.IExecutors;
return (<#=c.ITypeCollectionRequest()#>)this;
}

<# } #>
<# if (c.GetFeatures().CanSort) { #>
/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
public <#=c.ITypeCollectionRequest()#> orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (<#=c.ITypeCollectionRequest()#>)this;
}

<# } #>
}
31 changes: 15 additions & 16 deletions Templates/Java/requests_extensions/BaseMethodRequest.java.tt
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,6 @@ if (c.AsOdcmMethod().IsAction()) {
return (<#=c.TypeRequest()#>)this;
}

<#
}

if (c.GetFeatures().CanFilter) {
#>
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public <#=c.ITypeRequest()#> filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (<#=c.TypeRequest()#>)this;
}

<#
}

Expand Down Expand Up @@ -256,6 +240,21 @@ if (c.AsOdcmMethod().IsAction()) {
return (<#=c.TypeRequest()#>)this;
}

<#
}
if (c.GetFeatures().CanSort) {
#>
/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
public <#=c.ITypeRequest()#> orderBy(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (<#=c.TypeRequest()#>)this;
}

<#
}
if (c.AsOdcmProperty() != null && c.AsOdcmProperty().IsCollection && c.GetFeatures().CanUseTop) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ import <#=importNamespace#>.http.IHttpRequest;
*/
<#=c.ITypeCollectionRequest()#> filter(final String value);

<# } #>
<# if (c.GetFeatures().CanSort) { #>
/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
<#=c.ITypeCollectionRequest()#> orderBy(final String value);

<# } #>
<# if (c.GetFeatures().CanSelect) { #>
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ public ICallCollectionRequest filter(final String value) {
return (CallCollectionRequest)this;
}

/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
public ICallCollectionRequest orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (CallCollectionRequest)this;
}

/**
* Sets the select clause for the request
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ public ICallReferenceRequest expand(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$expand", value));
return (CallReferenceRequest)this;
}
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public ICallReferenceRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (CallReferenceRequest)this;
}
/**
* Puts the Call
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,5 @@ public ICallRequest expand(final String value) {
return (CallRequest)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public ICallRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (CallRequest)this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,4 @@ public ICallWithReferenceRequest expand(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$expand", value));
return (CallWithReferenceRequest)this;
}
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public ICallWithReferenceRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (CallWithReferenceRequest)this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,5 @@ public ICloudCommunicationsRequest expand(final String value) {
return (CloudCommunicationsRequest)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public ICloudCommunicationsRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (CloudCommunicationsRequest)this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,5 @@ public IEndpointRequest expand(final String value) {
return (EndpointRequest)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEndpointRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (EndpointRequest)this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,5 @@ public IEntityRequest expand(final String value) {
return (EntityRequest)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEntityRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (EntityRequest)this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ public IEntityType2CollectionRequest filter(final String value) {
return (EntityType2CollectionRequest)this;
}

/**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/
public IEntityType2CollectionRequest orderBy(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$orderby", value));
return (EntityType2CollectionRequest)this;
}

/**
* Sets the select clause for the request
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ public IEntityType2ReferenceRequest expand(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$expand", value));
return (EntityType2ReferenceRequest)this;
}
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEntityType2ReferenceRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (EntityType2ReferenceRequest)this;
}
/**
* Puts the EntityType2
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,5 @@ public IEntityType2Request expand(final String value) {
return (EntityType2Request)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEntityType2Request filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (EntityType2Request)this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,4 @@ public IEntityType2WithReferenceRequest expand(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$expand", value));
return (EntityType2WithReferenceRequest)this;
}
/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEntityType2WithReferenceRequest filter(final String value) {
getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value));
return (EntityType2WithReferenceRequest)this;
}
}
Loading