Skip to content

Commit

Permalink
- adds missing fluent method for odata filter
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Sep 10, 2020
1 parent 70d6cbf commit f320610
Show file tree
Hide file tree
Showing 64 changed files with 690 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ import <#=mainNamespace#>.<#=c.GetPackagePrefix()#>.<#=c.TypeName()#>;
return (<#=c.TypeCollectionReferenceRequest()#>)this;
}

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

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

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

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

<# } #>
<# if (c.GetFeatures().CanFilter) { #>
public <#=c.ITypeCollectionRequest()#> filter(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$filter", 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,6 +58,18 @@ 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: 13 additions & 0 deletions Templates/Java/requests_extensions/BaseEntityRequest.java.tt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ 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,4 +88,16 @@ 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;
}
<# } #>
}
13 changes: 13 additions & 0 deletions Templates/Java/requests_extensions/BaseMethodBodyRequest.java.tt
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,18 @@ 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 @@ -143,5 +143,18 @@ import <#=importNamespace#>.concurrency.IExecutors;
return (<#=c.ITypeCollectionRequest()#>)this;
}

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

<# } #>
}
30 changes: 30 additions & 0 deletions Templates/Java/requests_extensions/BaseMethodRequest.java.tt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ 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 @@ -227,7 +243,21 @@ if (c.AsOdcmMethod().IsAction()) {

<#
}
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 @@ -28,6 +28,16 @@ import <#=importNamespace#>.http.IBaseCollectionPage;
*/
<#=c.ITypeCollectionRequest()#> expand(final String value);

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

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

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public ICallCollectionRequest filter(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$filter", 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,6 +63,16 @@ 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,5 +154,16 @@ 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,4 +93,14 @@ 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,5 +162,16 @@ 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,5 +154,16 @@ 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,5 +69,16 @@ 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 @@ -84,6 +84,17 @@ public IEntityType2CollectionRequest expand(final String value) {
return (EntityType2CollectionRequest)this;
}

/**
* Sets the filter clause for the request
*
* @param value the filter clause
* @return the updated request
*/
public IEntityType2CollectionRequest filter(final String value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$filter", 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,6 +63,16 @@ 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,5 +154,16 @@ 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,4 +93,14 @@ 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

0 comments on commit f320610

Please sign in to comment.