diff --git a/README.md b/README.md index 00ad05bc935..6da9712366c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ repositories { dependencies { // Include the sdk as a dependency - implementation 'com.microsoft.graph:microsoft-graph:5.0.0' + implementation 'com.microsoft.graph:microsoft-graph:5.1.0' // Uncomment the line below if you are building an android application //implementation 'com.google.guava:guava:30.1.1-android' // This dependency is only needed if you are using the TokenCrendentialAuthProvider @@ -36,7 +36,7 @@ Add the dependency in `dependencies` in pom.xml com.microsoft.graph microsoft-graph - 5.0.0 + 5.1.0 @@ -135,3 +135,4 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MI ## 9. Third-party notices [Third-party notices](THIRD%20PARTY%20NOTICES) + diff --git a/gradle.properties b/gradle.properties index b22536b75fd..5d0a9deae1e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ org.gradle.caching=true mavenGroupId = com.microsoft.graph mavenArtifactId = microsoft-graph mavenMajorVersion = 5 -mavenMinorVersion = 0 +mavenMinorVersion = 1 mavenPatchVersion = 0 mavenArtifactSuffix = @@ -57,3 +57,4 @@ mavenCentralPublishingEnabled=false + diff --git a/src/main/java/com/microsoft/graph/info/Constants.java b/src/main/java/com/microsoft/graph/info/Constants.java index 25b87d4dc93..c88fdc4b937 100644 --- a/src/main/java/com/microsoft/graph/info/Constants.java +++ b/src/main/java/com/microsoft/graph/info/Constants.java @@ -18,7 +18,7 @@ private Constants() { /** The client secret to use for unit testing */ public static final String CLIENTSECRET = "clientsecret"; /** The SDK version */ - public static final String VERSION_NAME = "5.0.0"; + public static final String VERSION_NAME = "5.1.0"; } @@ -34,3 +34,4 @@ private Constants() { + diff --git a/src/main/java/com/microsoft/graph/models/AccessReviewInstance.java b/src/main/java/com/microsoft/graph/models/AccessReviewInstance.java index bee694446ff..8cd7f8afe91 100644 --- a/src/main/java/com/microsoft/graph/models/AccessReviewInstance.java +++ b/src/main/java/com/microsoft/graph/models/AccessReviewInstance.java @@ -41,7 +41,7 @@ public class AccessReviewInstance extends Entity implements IJsonBackedObject { /** * The Fallback Reviewers. - * + * This collection of reviewer scopes is used to define the list of fallback reviewers. These fallback reviewers will be notified to take action if no users are found from the list of reviewers specified. This could occur when either the group owner is specified as the reviewer but the group owner does not exist, or manager is specified as reviewer but a user's manager does not exist. Supports $select. */ @SerializedName(value = "fallbackReviewers", alternate = {"FallbackReviewers"}) @Expose @@ -50,7 +50,7 @@ public class AccessReviewInstance extends Entity implements IJsonBackedObject { /** * The Reviewers. - * + * This collection of access review scopes is used to define who the reviewers are. Supports $select. For examples of options for assigning reviewers, see Assign reviewers to your access review definition using the Microsoft Graph API. */ @SerializedName(value = "reviewers", alternate = {"Reviewers"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/AccessReviewScheduleDefinition.java b/src/main/java/com/microsoft/graph/models/AccessReviewScheduleDefinition.java index 1a06cfc834b..0a1af154637 100644 --- a/src/main/java/com/microsoft/graph/models/AccessReviewScheduleDefinition.java +++ b/src/main/java/com/microsoft/graph/models/AccessReviewScheduleDefinition.java @@ -115,7 +115,7 @@ public class AccessReviewScheduleDefinition extends Entity implements IJsonBacke /** * The Scope. - * Defines scope of resources to review. For supported scopes, see accessReviewScope. Required on create. Supports $select and $filter (contains only). For examples of options for configuring scope, see Configure the scope of your access review definition using the Microsoft Graph API. + * Defines the entities whose access is reviewed. For supported scopes, see accessReviewScope. Required on create. Supports $select and $filter (contains only). For examples of options for configuring scope, see Configure the scope of your access review definition using the Microsoft Graph API. */ @SerializedName(value = "scope", alternate = {"Scope"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/AuthenticationMethodTarget.java b/src/main/java/com/microsoft/graph/models/AuthenticationMethodTarget.java index 9821d388b9b..52970ee1beb 100644 --- a/src/main/java/com/microsoft/graph/models/AuthenticationMethodTarget.java +++ b/src/main/java/com/microsoft/graph/models/AuthenticationMethodTarget.java @@ -37,7 +37,7 @@ public class AuthenticationMethodTarget extends Entity implements IJsonBackedObj /** * The Target Type. - * Possible values are: user, group. + * Possible values are: user, group, and unknownFutureValue. */ @SerializedName(value = "targetType", alternate = {"TargetType"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/Compliance.java b/src/main/java/com/microsoft/graph/models/Compliance.java new file mode 100644 index 00000000000..401c952ed80 --- /dev/null +++ b/src/main/java/com/microsoft/graph/models/Compliance.java @@ -0,0 +1,50 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Compliance. + */ +public class Compliance implements IJsonBackedObject { + + /** the OData type of the object as returned by the service */ + @SerializedName("@odata.type") + @Expose + @Nullable + public String oDataType; + + private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); + + @Override + @Nonnull + public final AdditionalDataManager additionalDataManager() { + return additionalDataManager; + } + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + } +} diff --git a/src/main/java/com/microsoft/graph/models/ConditionalAccessApplications.java b/src/main/java/com/microsoft/graph/models/ConditionalAccessApplications.java index 7d9eb74f055..5e625c0325a 100644 --- a/src/main/java/com/microsoft/graph/models/ConditionalAccessApplications.java +++ b/src/main/java/com/microsoft/graph/models/ConditionalAccessApplications.java @@ -56,6 +56,15 @@ public final AdditionalDataManager additionalDataManager() { @Nullable public java.util.List includeApplications; + /** + * The Include Authentication Context Class References. + * Authentication context class references include. Supported values are c1 through c25. + */ + @SerializedName(value = "includeAuthenticationContextClassReferences", alternate = {"IncludeAuthenticationContextClassReferences"}) + @Expose + @Nullable + public java.util.List includeAuthenticationContextClassReferences; + /** * The Include User Actions. * User actions to include. Supported values are urn:user:registersecurityinfo and urn:user:registerdevice diff --git a/src/main/java/com/microsoft/graph/models/EducationAssignmentResource.java b/src/main/java/com/microsoft/graph/models/EducationAssignmentResource.java index 4111d46d050..11a11da90fe 100644 --- a/src/main/java/com/microsoft/graph/models/EducationAssignmentResource.java +++ b/src/main/java/com/microsoft/graph/models/EducationAssignmentResource.java @@ -28,7 +28,7 @@ public class EducationAssignmentResource extends Entity implements IJsonBackedOb /** * The Distribute For Student Work. - * Indicates whether this resource should be copied to each student submission for modification and submission. + * Indicates whether this resource should be copied to each student submission for modification and submission. Required */ @SerializedName(value = "distributeForStudentWork", alternate = {"DistributeForStudentWork"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/Group.java b/src/main/java/com/microsoft/graph/models/Group.java index 68674a8e260..858f9b40744 100644 --- a/src/main/java/com/microsoft/graph/models/Group.java +++ b/src/main/java/com/microsoft/graph/models/Group.java @@ -140,7 +140,7 @@ public class Group extends DirectoryObject implements IJsonBackedObject { /** * The Is Assignable To Role. - * Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true and the group cannot be a dynamic group (that is, groupTypes cannot contain DynamicMembership). Only callers in Global administrator and Privileged role administrator roles can set this property. The caller must also be assigned the Directory.AccessAsUser.All permission to set this property. For more, see Using a group to manage Azure AD role assignmentsReturned by default. Supports $filter (eq, ne, NOT). + * Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true and the group cannot be a dynamic group (that is, groupTypes cannot contain DynamicMembership). Only callers in Global administrator and Privileged role administrator roles can set this property. The caller must be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Azure AD role assignmentsReturned by default. Supports $filter (eq, ne, NOT). */ @SerializedName(value = "isAssignableToRole", alternate = {"IsAssignableToRole"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/Invitation.java b/src/main/java/com/microsoft/graph/models/Invitation.java index e07ac3ba1aa..e8173818981 100644 --- a/src/main/java/com/microsoft/graph/models/Invitation.java +++ b/src/main/java/com/microsoft/graph/models/Invitation.java @@ -83,7 +83,7 @@ public class Invitation extends Entity implements IJsonBackedObject { /** * The Send Invitation Message. - * Indicates whether an email should be sent to the user being invited or not. The default is false. + * Indicates whether an email should be sent to the user being invited. The default is false. */ @SerializedName(value = "sendInvitationMessage", alternate = {"SendInvitationMessage"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/MicrosoftAuthenticatorAuthenticationMethodTarget.java b/src/main/java/com/microsoft/graph/models/MicrosoftAuthenticatorAuthenticationMethodTarget.java index 743ae185875..423568e8918 100644 --- a/src/main/java/com/microsoft/graph/models/MicrosoftAuthenticatorAuthenticationMethodTarget.java +++ b/src/main/java/com/microsoft/graph/models/MicrosoftAuthenticatorAuthenticationMethodTarget.java @@ -29,7 +29,7 @@ public class MicrosoftAuthenticatorAuthenticationMethodTarget extends Authentica /** * The Authentication Mode. - * Determines which types of notifications can be used for sign-in. Possible values are: any, deviceBasedPush (passwordless only), push. + * Determines which types of notifications can be used for sign-in. The possible values are: deviceBasedPush (passwordless only), push, and any. */ @SerializedName(value = "authenticationMode", alternate = {"AuthenticationMode"}) @Expose @@ -38,7 +38,7 @@ public class MicrosoftAuthenticatorAuthenticationMethodTarget extends Authentica /** * The Feature Settings. - * Determines what additional settings should be applied to Microsoft Authenticator. Possible values are: null, requireNumberMatching (Requires number matching for MFA notifications. Value is ignored for phone sign-in notifications). + * Determines what additional settings should be applied to Microsoft Authenticator. The possible values are: requireNumberMatching (Requires number matching for MFA notifications. Value is ignored for phone sign-in notifications). Nullable. */ @SerializedName(value = "featureSettings", alternate = {"FeatureSettings"}) @Expose diff --git a/src/main/java/com/microsoft/graph/models/Site.java b/src/main/java/com/microsoft/graph/models/Site.java index 2d812c48f12..e83e04e8147 100644 --- a/src/main/java/com/microsoft/graph/models/Site.java +++ b/src/main/java/com/microsoft/graph/models/Site.java @@ -21,6 +21,7 @@ import com.microsoft.graph.models.List; import com.microsoft.graph.models.Permission; import com.microsoft.graph.models.Site; +import com.microsoft.graph.termstore.models.Store; import com.microsoft.graph.models.Onenote; import com.microsoft.graph.requests.ColumnDefinitionCollectionPage; import com.microsoft.graph.requests.ContentTypeCollectionPage; @@ -29,6 +30,7 @@ import com.microsoft.graph.requests.ListCollectionPage; import com.microsoft.graph.requests.PermissionCollectionPage; import com.microsoft.graph.requests.SiteCollectionPage; +import com.microsoft.graph.termstore.requests.StoreCollectionPage; import com.google.gson.JsonObject; @@ -171,6 +173,24 @@ public class Site extends BaseItem implements IJsonBackedObject { @Nullable public SiteCollectionPage sites; + /** + * The Term Store. + * The termStore under this site. + */ + @SerializedName(value = "termStore", alternate = {"TermStore"}) + @Expose + @Nullable + public Store termStore; + + /** + * The Term Stores. + * + */ + @SerializedName(value = "termStores", alternate = {"TermStores"}) + @Expose + @Nullable + public StoreCollectionPage termStores; + /** * The Onenote. * Calls the OneNote service for notebook related operations. @@ -217,5 +237,9 @@ public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final J if (json.has("sites")) { sites = serializer.deserializeObject(json.get("sites"), SiteCollectionPage.class); } + + if (json.has("termStores")) { + termStores = serializer.deserializeObject(json.get("termStores"), StoreCollectionPage.class); + } } } diff --git a/src/main/java/com/microsoft/graph/models/Subscription.java b/src/main/java/com/microsoft/graph/models/Subscription.java index b0af77a8a5d..acd8ebfbea3 100644 --- a/src/main/java/com/microsoft/graph/models/Subscription.java +++ b/src/main/java/com/microsoft/graph/models/Subscription.java @@ -133,6 +133,15 @@ public class Subscription extends Entity implements IJsonBackedObject { @Nullable public String notificationUrl; + /** + * The Notification Url App Id. + * + */ + @SerializedName(value = "notificationUrlAppId", alternate = {"NotificationUrlAppId"}) + @Expose + @Nullable + public String notificationUrlAppId; + /** * The Resource. * Specifies the resource that will be monitored for changes. Do not include the base URL (https://graph.microsoft.com/beta/). See the possible resource path values for each supported resource. Required. diff --git a/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequest.java b/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequest.java index 3155c0875a4..82d07fece78 100644 --- a/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequest.java +++ b/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequest.java @@ -7,7 +7,7 @@ import com.microsoft.graph.http.IRequestBuilder; import com.microsoft.graph.core.ClientException; -import com.microsoft.graph.models.Group; +import com.microsoft.graph.models.Device; import com.microsoft.graph.models.AppRoleAssignment; import com.microsoft.graph.models.DirectoryObject; import com.microsoft.graph.models.ExtensionProperty; diff --git a/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequestBuilder.java index 0829e3b76e6..847b770afa2 100644 --- a/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequestBuilder.java +++ b/src/main/java/com/microsoft/graph/requests/AppRoleAssignmentCollectionRequestBuilder.java @@ -7,7 +7,7 @@ import com.microsoft.graph.http.IRequestBuilder; import com.microsoft.graph.core.ClientException; -import com.microsoft.graph.models.Group; +import com.microsoft.graph.models.Device; import com.microsoft.graph.models.AppRoleAssignment; import com.microsoft.graph.models.DirectoryObject; import com.microsoft.graph.models.ExtensionProperty; @@ -40,7 +40,7 @@ public class AppRoleAssignmentCollectionRequestBuilder extends BaseCollectionRequestBuilder { /** - * The request builder for this collection of Group + * The request builder for this collection of Device * * @param requestUrl the request URL * @param client the service client diff --git a/src/main/java/com/microsoft/graph/requests/ComplianceRequest.java b/src/main/java/com/microsoft/graph/requests/ComplianceRequest.java new file mode 100644 index 00000000000..64e0f7e2fcf --- /dev/null +++ b/src/main/java/com/microsoft/graph/requests/ComplianceRequest.java @@ -0,0 +1,173 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.models.Compliance; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Compliance Request. + */ +public class ComplianceRequest extends BaseRequest { + + /** + * The request for the Compliance + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public ComplianceRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Compliance.class); + } + + /** + * Gets the Compliance from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Compliance from the service + * + * @return the Compliance from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Compliance get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Compliance delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Compliance with a source + * + * @param sourceCompliance the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Compliance sourceCompliance) { + return sendAsync(HttpMethod.PATCH, sourceCompliance); + } + + /** + * Patches this Compliance with a source + * + * @param sourceCompliance the source object with updates + * @return the updated Compliance + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Compliance patch(@Nonnull final Compliance sourceCompliance) throws ClientException { + return send(HttpMethod.PATCH, sourceCompliance); + } + + /** + * Creates a Compliance with a new object + * + * @param newCompliance the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Compliance newCompliance) { + return sendAsync(HttpMethod.POST, newCompliance); + } + + /** + * Creates a Compliance with a new object + * + * @param newCompliance the new object to create + * @return the created Compliance + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Compliance post(@Nonnull final Compliance newCompliance) throws ClientException { + return send(HttpMethod.POST, newCompliance); + } + + /** + * Creates a Compliance with a new object + * + * @param newCompliance the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Compliance newCompliance) { + return sendAsync(HttpMethod.PUT, newCompliance); + } + + /** + * Creates a Compliance with a new object + * + * @param newCompliance the object to create/update + * @return the created Compliance + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Compliance put(@Nonnull final Compliance newCompliance) throws ClientException { + return send(HttpMethod.PUT, newCompliance); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public ComplianceRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public ComplianceRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/requests/ComplianceRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/ComplianceRequestBuilder.java new file mode 100644 index 00000000000..7672042f4d7 --- /dev/null +++ b/src/main/java/com/microsoft/graph/requests/ComplianceRequestBuilder.java @@ -0,0 +1,59 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.models.Compliance; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Compliance Request Builder. + */ +public class ComplianceRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Compliance + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public ComplianceRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the ComplianceRequest instance + */ + @Nonnull + public ComplianceRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the ComplianceRequest instance + */ + @Nonnull + public ComplianceRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.requests.ComplianceRequest(getRequestUrl(), getClient(), requestOptions); + } + + +} diff --git a/src/main/java/com/microsoft/graph/requests/GraphServiceClient.java b/src/main/java/com/microsoft/graph/requests/GraphServiceClient.java index 618048aa099..1290a9cf379 100644 --- a/src/main/java/com/microsoft/graph/requests/GraphServiceClient.java +++ b/src/main/java/com/microsoft/graph/requests/GraphServiceClient.java @@ -87,6 +87,7 @@ import com.microsoft.graph.requests.TeamsTemplateRequestBuilder; import com.microsoft.graph.requests.AuditLogRootRequestBuilder; import com.microsoft.graph.requests.AuthenticationMethodsPolicyRequestBuilder; +import com.microsoft.graph.requests.ComplianceRequestBuilder; import com.microsoft.graph.requests.IdentityContainerRequestBuilder; import com.microsoft.graph.requests.OrganizationalBrandingRequestBuilder; import com.microsoft.graph.requests.DirectoryRequestBuilder; @@ -1092,6 +1093,16 @@ public AuthenticationMethodsPolicyRequestBuilder authenticationMethodsPolicy() { return new AuthenticationMethodsPolicyRequestBuilder(getServiceRoot() + "/authenticationMethodsPolicy", this, null); } + /** + * Gets the GraphServiceRequestBuilder + * + * @return the Compliance + */ + @Nonnull + public ComplianceRequestBuilder compliance() { + return new ComplianceRequestBuilder(getServiceRoot() + "/compliance", this, null); + } + /** * Gets the GraphServiceRequestBuilder * diff --git a/src/main/java/com/microsoft/graph/requests/SiteGetByPathRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/SiteGetByPathRequestBuilder.java index 49a27cdf241..d84645e65c7 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteGetByPathRequestBuilder.java +++ b/src/main/java/com/microsoft/graph/requests/SiteGetByPathRequestBuilder.java @@ -5,6 +5,8 @@ package com.microsoft.graph.requests; import com.microsoft.graph.requests.SiteGetByPathRequest; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.models.Site; import com.microsoft.graph.http.BaseFunctionRequestBuilder; import com.microsoft.graph.models.SiteGetByPathParameterSet; @@ -254,6 +256,36 @@ public SiteRequestBuilder sites(@Nonnull final String id) { return new SiteRequestBuilder(getRequestUrlWithAdditionalSegment("sites") + "/" + id, getClient(), null); } + /** + * Gets the request builder for Store + * + * @return the StoreRequestBuilder instance + */ + @Nonnull + public StoreRequestBuilder termStore() { + return new StoreRequestBuilder(getRequestUrlWithAdditionalSegment("termStore"), getClient(), null); + } + /** + * Gets a request builder for the Store collection + * + * @return the collection request builder + */ + @Nonnull + public StoreCollectionRequestBuilder termStores() { + return new StoreCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("termStores"), getClient(), null); + } + + /** + * Gets a request builder for the Store item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public StoreRequestBuilder termStores(@Nonnull final String id) { + return new StoreRequestBuilder(getRequestUrlWithAdditionalSegment("termStores") + "/" + id, getClient(), null); + } + /** * Gets the request builder for Onenote * diff --git a/src/main/java/com/microsoft/graph/requests/SiteReferenceRequest.java b/src/main/java/com/microsoft/graph/requests/SiteReferenceRequest.java index 95c2a391c12..cff8dd5f92f 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteReferenceRequest.java +++ b/src/main/java/com/microsoft/graph/requests/SiteReferenceRequest.java @@ -24,6 +24,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; diff --git a/src/main/java/com/microsoft/graph/requests/SiteReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/SiteReferenceRequestBuilder.java index b8f8394ea23..12fbd170f2d 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteReferenceRequestBuilder.java +++ b/src/main/java/com/microsoft/graph/requests/SiteReferenceRequestBuilder.java @@ -25,6 +25,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; diff --git a/src/main/java/com/microsoft/graph/requests/SiteRequest.java b/src/main/java/com/microsoft/graph/requests/SiteRequest.java index 91088679cd8..6f3fc0043a6 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteRequest.java +++ b/src/main/java/com/microsoft/graph/requests/SiteRequest.java @@ -24,6 +24,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; diff --git a/src/main/java/com/microsoft/graph/requests/SiteRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/SiteRequestBuilder.java index 9e91481385f..b19c006ff58 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteRequestBuilder.java +++ b/src/main/java/com/microsoft/graph/requests/SiteRequestBuilder.java @@ -24,6 +24,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; @@ -256,6 +258,36 @@ public SiteRequestBuilder sites(@Nonnull final String id) { return new SiteRequestBuilder(getRequestUrlWithAdditionalSegment("sites") + "/" + id, getClient(), null); } + /** + * Gets the request builder for Store + * + * @return the StoreRequestBuilder instance + */ + @Nonnull + public StoreRequestBuilder termStore() { + return new StoreRequestBuilder(getRequestUrlWithAdditionalSegment("termStore"), getClient(), null); + } + /** + * Gets a request builder for the Store collection + * + * @return the collection request builder + */ + @Nonnull + public StoreCollectionRequestBuilder termStores() { + return new StoreCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("termStores"), getClient(), null); + } + + /** + * Gets a request builder for the Store item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public StoreRequestBuilder termStores(@Nonnull final String id) { + return new StoreRequestBuilder(getRequestUrlWithAdditionalSegment("termStores") + "/" + id, getClient(), null); + } + /** * Gets the request builder for Onenote * diff --git a/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequest.java b/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequest.java index 155945693cf..f15c1e66319 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequest.java +++ b/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequest.java @@ -24,6 +24,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; diff --git a/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequestBuilder.java index a9f440a8726..6638e83ecac 100644 --- a/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequestBuilder.java +++ b/src/main/java/com/microsoft/graph/requests/SiteWithReferenceRequestBuilder.java @@ -24,6 +24,8 @@ import com.microsoft.graph.requests.PermissionRequestBuilder; import com.microsoft.graph.requests.SiteCollectionRequestBuilder; import com.microsoft.graph.requests.SiteRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; import com.microsoft.graph.requests.OnenoteRequestBuilder; import java.util.Arrays; import java.util.EnumSet; diff --git a/src/main/java/com/microsoft/graph/termstore/models/Group.java b/src/main/java/com/microsoft/graph/termstore/models/Group.java new file mode 100644 index 00000000000..82b59b0a613 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/Group.java @@ -0,0 +1,100 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; +import com.microsoft.graph.http.BaseCollectionPage; +import com.microsoft.graph.termstore.models.TermGroupScope; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.models.Entity; +import com.microsoft.graph.termstore.requests.SetCollectionPage; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group. + */ +public class Group extends Entity implements IJsonBackedObject { + + + /** + * The Created Date Time. + * Date and time of group creation. Read-only. + */ + @SerializedName(value = "createdDateTime", alternate = {"CreatedDateTime"}) + @Expose + @Nullable + public java.time.OffsetDateTime createdDateTime; + + /** + * The Description. + * Description giving details on the term usage. + */ + @SerializedName(value = "description", alternate = {"Description"}) + @Expose + @Nullable + public String description; + + /** + * The Display Name. + * Name of group. + */ + @SerializedName(value = "displayName", alternate = {"DisplayName"}) + @Expose + @Nullable + public String displayName; + + /** + * The Parent Site Id. + * Id of the parent site of this group. + */ + @SerializedName(value = "parentSiteId", alternate = {"ParentSiteId"}) + @Expose + @Nullable + public String parentSiteId; + + /** + * The Scope. + * Returns type of group. Possible values are 'global', 'system' and 'siteCollection'. + */ + @SerializedName(value = "scope", alternate = {"Scope"}) + @Expose + @Nullable + public TermGroupScope scope; + + /** + * The Sets. + * All sets under the group in a term [store]. + */ + @SerializedName(value = "sets", alternate = {"Sets"}) + @Expose + @Nullable + public SetCollectionPage sets; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + + if (json.has("sets")) { + sets = serializer.deserializeObject(json.get("sets"), SetCollectionPage.class); + } + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/LocalizedDescription.java b/src/main/java/com/microsoft/graph/termstore/models/LocalizedDescription.java new file mode 100644 index 00000000000..c253b9e1cda --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/LocalizedDescription.java @@ -0,0 +1,68 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Localized Description. + */ +public class LocalizedDescription implements IJsonBackedObject { + + /** the OData type of the object as returned by the service */ + @SerializedName("@odata.type") + @Expose + @Nullable + public String oDataType; + + private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); + + @Override + @Nonnull + public final AdditionalDataManager additionalDataManager() { + return additionalDataManager; + } + + /** + * The Description. + * The description in the localized language. + */ + @SerializedName(value = "description", alternate = {"Description"}) + @Expose + @Nullable + public String description; + + /** + * The Language Tag. + * The language tag for the label. + */ + @SerializedName(value = "languageTag", alternate = {"LanguageTag"}) + @Expose + @Nullable + public String languageTag; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/LocalizedLabel.java b/src/main/java/com/microsoft/graph/termstore/models/LocalizedLabel.java new file mode 100644 index 00000000000..2ec216208fc --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/LocalizedLabel.java @@ -0,0 +1,77 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Localized Label. + */ +public class LocalizedLabel implements IJsonBackedObject { + + /** the OData type of the object as returned by the service */ + @SerializedName("@odata.type") + @Expose + @Nullable + public String oDataType; + + private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); + + @Override + @Nonnull + public final AdditionalDataManager additionalDataManager() { + return additionalDataManager; + } + + /** + * The Is Default. + * Indicates whether the label is the default label. + */ + @SerializedName(value = "isDefault", alternate = {"IsDefault"}) + @Expose + @Nullable + public Boolean isDefault; + + /** + * The Language Tag. + * The language tag for the label. + */ + @SerializedName(value = "languageTag", alternate = {"LanguageTag"}) + @Expose + @Nullable + public String languageTag; + + /** + * The Name. + * The name of the label. + */ + @SerializedName(value = "name", alternate = {"Name"}) + @Expose + @Nullable + public String name; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/LocalizedName.java b/src/main/java/com/microsoft/graph/termstore/models/LocalizedName.java new file mode 100644 index 00000000000..d4a558ad3a5 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/LocalizedName.java @@ -0,0 +1,68 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Localized Name. + */ +public class LocalizedName implements IJsonBackedObject { + + /** the OData type of the object as returned by the service */ + @SerializedName("@odata.type") + @Expose + @Nullable + public String oDataType; + + private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); + + @Override + @Nonnull + public final AdditionalDataManager additionalDataManager() { + return additionalDataManager; + } + + /** + * The Language Tag. + * The language tag for the label. + */ + @SerializedName(value = "languageTag", alternate = {"LanguageTag"}) + @Expose + @Nullable + public String languageTag; + + /** + * The Name. + * The name in the localized language. + */ + @SerializedName(value = "name", alternate = {"Name"}) + @Expose + @Nullable + public String name; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/Relation.java b/src/main/java/com/microsoft/graph/termstore/models/Relation.java new file mode 100644 index 00000000000..2e1a2bedab0 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/Relation.java @@ -0,0 +1,77 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; +import com.microsoft.graph.termstore.models.RelationType; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.models.Entity; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation. + */ +public class Relation extends Entity implements IJsonBackedObject { + + + /** + * The Relationship. + * The type of relation. Possible values are: pin, reuse. + */ + @SerializedName(value = "relationship", alternate = {"Relationship"}) + @Expose + @Nullable + public RelationType relationship; + + /** + * The From Term. + * The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set]. + */ + @SerializedName(value = "fromTerm", alternate = {"FromTerm"}) + @Expose + @Nullable + public Term fromTerm; + + /** + * The Set. + * The [set] in which the relation is relevant. + */ + @SerializedName(value = "set", alternate = {"Set"}) + @Expose + @Nullable + public Set set; + + /** + * The To Term. + * The to [term] of the relation. The term to which the relationship is defined. + */ + @SerializedName(value = "toTerm", alternate = {"ToTerm"}) + @Expose + @Nullable + public Term toTerm; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/RelationType.java b/src/main/java/com/microsoft/graph/termstore/models/RelationType.java new file mode 100644 index 00000000000..0f29bdb5306 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/RelationType.java @@ -0,0 +1,30 @@ +// Template Source: Enum.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; + + +/** + * The Enum Relation Type. +*/ +public enum RelationType +{ + /** + * pin + */ + PIN, + /** + * reuse + */ + REUSE, + /** + * unknown Future Value + */ + UNKNOWN_FUTURE_VALUE, + /** + * For RelationType values that were not expected from the service + */ + UNEXPECTED_VALUE +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/Set.java b/src/main/java/com/microsoft/graph/termstore/models/Set.java new file mode 100644 index 00000000000..49e70eacab4 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/Set.java @@ -0,0 +1,130 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; +import com.microsoft.graph.http.BaseCollectionPage; +import com.microsoft.graph.termstore.models.LocalizedName; +import com.microsoft.graph.models.KeyValue; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.models.Relation; +import com.microsoft.graph.models.Entity; +import com.microsoft.graph.termstore.requests.TermCollectionPage; +import com.microsoft.graph.termstore.requests.RelationCollectionPage; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set. + */ +public class Set extends Entity implements IJsonBackedObject { + + + /** + * The Created Date Time. + * Date and time of set creation. Read-only. + */ + @SerializedName(value = "createdDateTime", alternate = {"CreatedDateTime"}) + @Expose + @Nullable + public java.time.OffsetDateTime createdDateTime; + + /** + * The Description. + * Description giving details on the term usage. + */ + @SerializedName(value = "description", alternate = {"Description"}) + @Expose + @Nullable + public String description; + + /** + * The Localized Names. + * Name of the set for each languageTag. + */ + @SerializedName(value = "localizedNames", alternate = {"LocalizedNames"}) + @Expose + @Nullable + public java.util.List localizedNames; + + /** + * The Properties. + * Custom properties for the set. + */ + @SerializedName(value = "properties", alternate = {"Properties"}) + @Expose + @Nullable + public java.util.List properties; + + /** + * The Children. + * Children terms of set in term [store]. + */ + @SerializedName(value = "children", alternate = {"Children"}) + @Expose + @Nullable + public TermCollectionPage children; + + /** + * The Parent Group. + * The parent [group] that contains the set. + */ + @SerializedName(value = "parentGroup", alternate = {"ParentGroup"}) + @Expose + @Nullable + public Group parentGroup; + + /** + * The Relations. + * Indicates which terms have been pinned or reused directly under the set. + */ + @SerializedName(value = "relations", alternate = {"Relations"}) + @Expose + @Nullable + public RelationCollectionPage relations; + + /** + * The Terms. + * All the terms under the set. + */ + @SerializedName(value = "terms", alternate = {"Terms"}) + @Expose + @Nullable + public TermCollectionPage terms; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + + if (json.has("children")) { + children = serializer.deserializeObject(json.get("children"), TermCollectionPage.class); + } + + if (json.has("relations")) { + relations = serializer.deserializeObject(json.get("relations"), RelationCollectionPage.class); + } + + if (json.has("terms")) { + terms = serializer.deserializeObject(json.get("terms"), TermCollectionPage.class); + } + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/Store.java b/src/main/java/com/microsoft/graph/termstore/models/Store.java new file mode 100644 index 00000000000..ceea54e824f --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/Store.java @@ -0,0 +1,87 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; +import com.microsoft.graph.http.BaseCollectionPage; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.models.Entity; +import com.microsoft.graph.termstore.requests.GroupCollectionPage; +import com.microsoft.graph.termstore.requests.SetCollectionPage; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store. + */ +public class Store extends Entity implements IJsonBackedObject { + + + /** + * The Default Language Tag. + * Default language of the term store. + */ + @SerializedName(value = "defaultLanguageTag", alternate = {"DefaultLanguageTag"}) + @Expose + @Nullable + public String defaultLanguageTag; + + /** + * The Language Tags. + * List of languages for the term store. + */ + @SerializedName(value = "languageTags", alternate = {"LanguageTags"}) + @Expose + @Nullable + public java.util.List languageTags; + + /** + * The Groups. + * Collection of all groups available in the term store. + */ + @SerializedName(value = "groups", alternate = {"Groups"}) + @Expose + @Nullable + public GroupCollectionPage groups; + + /** + * The Sets. + * Collection of all sets available in the term store. + */ + @SerializedName(value = "sets", alternate = {"Sets"}) + @Expose + @Nullable + public SetCollectionPage sets; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + + if (json.has("groups")) { + groups = serializer.deserializeObject(json.get("groups"), GroupCollectionPage.class); + } + + if (json.has("sets")) { + sets = serializer.deserializeObject(json.get("sets"), SetCollectionPage.class); + } + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/Term.java b/src/main/java/com/microsoft/graph/termstore/models/Term.java new file mode 100644 index 00000000000..99d13576039 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/Term.java @@ -0,0 +1,127 @@ +// Template Source: BaseEntity.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; +import com.microsoft.graph.serializer.ISerializer; +import com.microsoft.graph.serializer.IJsonBackedObject; +import com.microsoft.graph.serializer.AdditionalDataManager; +import java.util.EnumSet; +import com.microsoft.graph.http.BaseCollectionPage; +import com.microsoft.graph.termstore.models.LocalizedDescription; +import com.microsoft.graph.termstore.models.LocalizedLabel; +import com.microsoft.graph.models.KeyValue; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.models.Relation; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.models.Entity; +import com.microsoft.graph.termstore.requests.TermCollectionPage; +import com.microsoft.graph.termstore.requests.RelationCollectionPage; + + +import com.google.gson.JsonObject; +import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.Expose; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term. + */ +public class Term extends Entity implements IJsonBackedObject { + + + /** + * The Created Date Time. + * Date and time of term creation. Read-only + */ + @SerializedName(value = "createdDateTime", alternate = {"CreatedDateTime"}) + @Expose + @Nullable + public java.time.OffsetDateTime createdDateTime; + + /** + * The Descriptions. + * Description about term that is dependent on the languageTag + */ + @SerializedName(value = "descriptions", alternate = {"Descriptions"}) + @Expose + @Nullable + public java.util.List descriptions; + + /** + * The Labels. + * Label metadata for a term + */ + @SerializedName(value = "labels", alternate = {"Labels"}) + @Expose + @Nullable + public java.util.List labels; + + /** + * The Last Modified Date Time. + * Last date and time of term modification. Read-only + */ + @SerializedName(value = "lastModifiedDateTime", alternate = {"LastModifiedDateTime"}) + @Expose + @Nullable + public java.time.OffsetDateTime lastModifiedDateTime; + + /** + * The Properties. + * Collection of properties on the term + */ + @SerializedName(value = "properties", alternate = {"Properties"}) + @Expose + @Nullable + public java.util.List properties; + + /** + * The Children. + * Children of current term + */ + @SerializedName(value = "children", alternate = {"Children"}) + @Expose + @Nullable + public TermCollectionPage children; + + /** + * The Relations. + * To indicate which terms are related to the current term as either pinned or reused + */ + @SerializedName(value = "relations", alternate = {"Relations"}) + @Expose + @Nullable + public RelationCollectionPage relations; + + /** + * The Set. + * The [set] in which the term is created + */ + @SerializedName(value = "set", alternate = {"Set"}) + @Expose + @Nullable + public Set set; + + + /** + * Sets the raw JSON object + * + * @param serializer the serializer + * @param json the JSON object to set this object to + */ + public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { + + + if (json.has("children")) { + children = serializer.deserializeObject(json.get("children"), TermCollectionPage.class); + } + + if (json.has("relations")) { + relations = serializer.deserializeObject(json.get("relations"), RelationCollectionPage.class); + } + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/models/TermGroupScope.java b/src/main/java/com/microsoft/graph/termstore/models/TermGroupScope.java new file mode 100644 index 00000000000..91a032bc37c --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/models/TermGroupScope.java @@ -0,0 +1,34 @@ +// Template Source: Enum.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.models; + + +/** + * The Enum Term Group Scope. +*/ +public enum TermGroupScope +{ + /** + * global + */ + GLOBAL, + /** + * system + */ + SYSTEM, + /** + * site Collection + */ + SITE_COLLECTION, + /** + * unknown Future Value + */ + UNKNOWN_FUTURE_VALUE, + /** + * For TermGroupScope values that were not expected from the service + */ + UNEXPECTED_VALUE +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionPage.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionPage.java new file mode 100644 index 00000000000..cb32e61dac4 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionPage.java @@ -0,0 +1,40 @@ +// Template Source: BaseEntityCollectionPage.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.requests.GroupCollectionRequestBuilder; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.termstore.requests.GroupCollectionResponse; +import com.microsoft.graph.http.BaseCollectionPage; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Collection Page. + */ +public class GroupCollectionPage extends BaseCollectionPage { + + /** + * A collection page for Group + * + * @param response the serialized GroupCollectionResponse from the service + * @param builder the request builder for the next collection page + */ + public GroupCollectionPage(@Nonnull final GroupCollectionResponse response, @Nonnull final GroupCollectionRequestBuilder builder) { + super(response, builder); + } + + /** + * Creates the collection page for Group + * + * @param pageContents the contents of this page + * @param nextRequestBuilder the request builder for the next page + */ + public GroupCollectionPage(@Nonnull final java.util.List pageContents, @Nullable final GroupCollectionRequestBuilder nextRequestBuilder) { + super(pageContents, nextRequestBuilder); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequest.java new file mode 100644 index 00000000000..383a61aae4e --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequest.java @@ -0,0 +1,173 @@ +// Template Source: BaseEntityCollectionRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Store; +import com.microsoft.graph.termstore.models.Group; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseEntityCollectionRequest; +import com.microsoft.graph.termstore.requests.GroupCollectionResponse; +import com.microsoft.graph.termstore.requests.GroupCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupCollectionRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Collection Request. + */ +public class GroupCollectionRequest extends BaseEntityCollectionRequest { + + /** + * The request builder for this collection of Group + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public GroupCollectionRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, GroupCollectionResponse.class, GroupCollectionPage.class, GroupCollectionRequestBuilder.class); + } + + /** + * Creates a new Group + * @param newGroup the Group to create + * @return a future with the created object + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Group newGroup) { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new GroupRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .postAsync(newGroup); + } + + /** + * Creates a new Group + * @param newGroup the Group to create + * @return the newly created object + */ + @Nonnull + public Group post(@Nonnull final Group newGroup) throws ClientException { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new GroupRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .post(newGroup); + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest filter(@Nonnull final String value) { + addFilterOption(value); + return this; + } + + /** + * Sets the order by clause for the request + * + * @param value the order by clause + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest orderBy(@Nonnull final String value) { + addOrderByOption(value); + return this; + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the top value for the request + * + * @param value the max number of items to return + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest top(final int value) { + addTopOption(value); + return this; + } + + /** + * Sets the count value for the request + * + * @param value whether or not to return the count of objects with the request + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest count(final boolean value) { + addCountOption(value); + return this; + } + /** + * Sets the count value to true for the request + * + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest count() { + addCountOption(true); + return this; + } + /** + * Sets the skip value for the request + * + * @param value of the number of items to skip + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest skip(final int value) { + addSkipOption(value); + return this; + } + + + /** + * Add Skip token for pagination + * @param skipToken - Token for pagination + * @return the updated request + */ + @Nonnull + public GroupCollectionRequest skipToken(@Nonnull final String skipToken) { + addSkipTokenOption(skipToken); + return this; + } +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequestBuilder.java new file mode 100644 index 00000000000..fcbf887d28c --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionRequestBuilder.java @@ -0,0 +1,51 @@ +// Template Source: BaseEntityCollectionRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Store; +import com.microsoft.graph.termstore.models.Group; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.termstore.requests.GroupCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupCollectionRequest; +import com.microsoft.graph.http.BaseCollectionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.PrimitiveRequestBuilder; +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Collection Request Builder. + */ +public class GroupCollectionRequestBuilder extends BaseCollectionRequestBuilder { + + /** + * The request builder for this collection of Store + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public GroupCollectionRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, GroupRequestBuilder.class, GroupCollectionRequest.class); + } + + + + /** + * Gets the raw count request for the collection + * @return The raw count request for the collection + */ + @Nonnull + public PrimitiveRequestBuilder count() { + return new PrimitiveRequestBuilder(getRequestUrlWithAdditionalSegment("$count"), getClient(), null, Long.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionResponse.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionResponse.java new file mode 100644 index 00000000000..246030dd44a --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupCollectionResponse.java @@ -0,0 +1,18 @@ +// Template Source: BaseEntityCollectionResponse.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Group; + +import com.microsoft.graph.http.BaseCollectionResponse; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Collection Response. + */ +public class GroupCollectionResponse extends BaseCollectionResponse { + +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupRequest.java new file mode 100644 index 00000000000..c2dd5136415 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupRequest.java @@ -0,0 +1,175 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Request. + */ +public class GroupRequest extends BaseRequest { + + /** + * The request for the Group + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public GroupRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Group.class); + } + + /** + * Gets the Group from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Group from the service + * + * @return the Group from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Group get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Group delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Group with a source + * + * @param sourceGroup the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Group sourceGroup) { + return sendAsync(HttpMethod.PATCH, sourceGroup); + } + + /** + * Patches this Group with a source + * + * @param sourceGroup the source object with updates + * @return the updated Group + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Group patch(@Nonnull final Group sourceGroup) throws ClientException { + return send(HttpMethod.PATCH, sourceGroup); + } + + /** + * Creates a Group with a new object + * + * @param newGroup the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Group newGroup) { + return sendAsync(HttpMethod.POST, newGroup); + } + + /** + * Creates a Group with a new object + * + * @param newGroup the new object to create + * @return the created Group + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Group post(@Nonnull final Group newGroup) throws ClientException { + return send(HttpMethod.POST, newGroup); + } + + /** + * Creates a Group with a new object + * + * @param newGroup the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Group newGroup) { + return sendAsync(HttpMethod.PUT, newGroup); + } + + /** + * Creates a Group with a new object + * + * @param newGroup the object to create/update + * @return the created Group + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Group put(@Nonnull final Group newGroup) throws ClientException { + return send(HttpMethod.PUT, newGroup); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public GroupRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public GroupRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/GroupRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/GroupRequestBuilder.java new file mode 100644 index 00000000000..d66525b9e4e --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/GroupRequestBuilder.java @@ -0,0 +1,81 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Group Request Builder. + */ +public class GroupRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Group + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public GroupRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the GroupRequest instance + */ + @Nonnull + public GroupRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the GroupRequest instance + */ + @Nonnull + public GroupRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.termstore.requests.GroupRequest(getRequestUrl(), getClient(), requestOptions); + } + + + /** + * Gets a request builder for the Set collection + * + * @return the collection request builder + */ + @Nonnull + public SetCollectionRequestBuilder sets() { + return new SetCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("sets"), getClient(), null); + } + + /** + * Gets a request builder for the Set item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public SetRequestBuilder sets(@Nonnull final String id) { + return new SetRequestBuilder(getRequestUrlWithAdditionalSegment("sets") + "/" + id, getClient(), null); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionPage.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionPage.java new file mode 100644 index 00000000000..ad010480377 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionPage.java @@ -0,0 +1,40 @@ +// Template Source: BaseEntityCollectionPage.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Relation; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.termstore.requests.RelationCollectionResponse; +import com.microsoft.graph.http.BaseCollectionPage; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Collection Page. + */ +public class RelationCollectionPage extends BaseCollectionPage { + + /** + * A collection page for Relation + * + * @param response the serialized RelationCollectionResponse from the service + * @param builder the request builder for the next collection page + */ + public RelationCollectionPage(@Nonnull final RelationCollectionResponse response, @Nonnull final RelationCollectionRequestBuilder builder) { + super(response, builder); + } + + /** + * Creates the collection page for Relation + * + * @param pageContents the contents of this page + * @param nextRequestBuilder the request builder for the next page + */ + public RelationCollectionPage(@Nonnull final java.util.List pageContents, @Nullable final RelationCollectionRequestBuilder nextRequestBuilder) { + super(pageContents, nextRequestBuilder); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequest.java new file mode 100644 index 00000000000..b4133a4c383 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequest.java @@ -0,0 +1,173 @@ +// Template Source: BaseEntityCollectionRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.models.Relation; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseEntityCollectionRequest; +import com.microsoft.graph.termstore.requests.RelationCollectionResponse; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Collection Request. + */ +public class RelationCollectionRequest extends BaseEntityCollectionRequest { + + /** + * The request builder for this collection of Relation + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public RelationCollectionRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, RelationCollectionResponse.class, RelationCollectionPage.class, RelationCollectionRequestBuilder.class); + } + + /** + * Creates a new Relation + * @param newRelation the Relation to create + * @return a future with the created object + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Relation newRelation) { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new RelationRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .postAsync(newRelation); + } + + /** + * Creates a new Relation + * @param newRelation the Relation to create + * @return the newly created object + */ + @Nonnull + public Relation post(@Nonnull final Relation newRelation) throws ClientException { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new RelationRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .post(newRelation); + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest filter(@Nonnull final String value) { + addFilterOption(value); + return this; + } + + /** + * Sets the order by clause for the request + * + * @param value the order by clause + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest orderBy(@Nonnull final String value) { + addOrderByOption(value); + return this; + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the top value for the request + * + * @param value the max number of items to return + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest top(final int value) { + addTopOption(value); + return this; + } + + /** + * Sets the count value for the request + * + * @param value whether or not to return the count of objects with the request + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest count(final boolean value) { + addCountOption(value); + return this; + } + /** + * Sets the count value to true for the request + * + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest count() { + addCountOption(true); + return this; + } + /** + * Sets the skip value for the request + * + * @param value of the number of items to skip + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest skip(final int value) { + addSkipOption(value); + return this; + } + + + /** + * Add Skip token for pagination + * @param skipToken - Token for pagination + * @return the updated request + */ + @Nonnull + public RelationCollectionRequest skipToken(@Nonnull final String skipToken) { + addSkipTokenOption(skipToken); + return this; + } +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequestBuilder.java new file mode 100644 index 00000000000..a13a968d8dd --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionRequestBuilder.java @@ -0,0 +1,51 @@ +// Template Source: BaseEntityCollectionRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.models.Relation; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequest; +import com.microsoft.graph.http.BaseCollectionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.PrimitiveRequestBuilder; +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Collection Request Builder. + */ +public class RelationCollectionRequestBuilder extends BaseCollectionRequestBuilder { + + /** + * The request builder for this collection of Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public RelationCollectionRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, RelationRequestBuilder.class, RelationCollectionRequest.class); + } + + + + /** + * Gets the raw count request for the collection + * @return The raw count request for the collection + */ + @Nonnull + public PrimitiveRequestBuilder count() { + return new PrimitiveRequestBuilder(getRequestUrlWithAdditionalSegment("$count"), getClient(), null, Long.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionResponse.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionResponse.java new file mode 100644 index 00000000000..dd4c27555f5 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationCollectionResponse.java @@ -0,0 +1,18 @@ +// Template Source: BaseEntityCollectionResponse.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Relation; + +import com.microsoft.graph.http.BaseCollectionResponse; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Collection Response. + */ +public class RelationCollectionResponse extends BaseCollectionResponse { + +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationRequest.java new file mode 100644 index 00000000000..f4219767afb --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationRequest.java @@ -0,0 +1,175 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Relation; +import com.microsoft.graph.termstore.requests.TermWithReferenceRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Request. + */ +public class RelationRequest extends BaseRequest { + + /** + * The request for the Relation + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public RelationRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Relation.class); + } + + /** + * Gets the Relation from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Relation from the service + * + * @return the Relation from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Relation get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Relation delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Relation with a source + * + * @param sourceRelation the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Relation sourceRelation) { + return sendAsync(HttpMethod.PATCH, sourceRelation); + } + + /** + * Patches this Relation with a source + * + * @param sourceRelation the source object with updates + * @return the updated Relation + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Relation patch(@Nonnull final Relation sourceRelation) throws ClientException { + return send(HttpMethod.PATCH, sourceRelation); + } + + /** + * Creates a Relation with a new object + * + * @param newRelation the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Relation newRelation) { + return sendAsync(HttpMethod.POST, newRelation); + } + + /** + * Creates a Relation with a new object + * + * @param newRelation the new object to create + * @return the created Relation + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Relation post(@Nonnull final Relation newRelation) throws ClientException { + return send(HttpMethod.POST, newRelation); + } + + /** + * Creates a Relation with a new object + * + * @param newRelation the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Relation newRelation) { + return sendAsync(HttpMethod.PUT, newRelation); + } + + /** + * Creates a Relation with a new object + * + * @param newRelation the object to create/update + * @return the created Relation + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Relation put(@Nonnull final Relation newRelation) throws ClientException { + return send(HttpMethod.PUT, newRelation); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public RelationRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public RelationRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/RelationRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/RelationRequestBuilder.java new file mode 100644 index 00000000000..330589854cc --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/RelationRequestBuilder.java @@ -0,0 +1,91 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Relation; +import com.microsoft.graph.termstore.requests.TermWithReferenceRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Relation Request Builder. + */ +public class RelationRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Relation + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public RelationRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the RelationRequest instance + */ + @Nonnull + public RelationRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the RelationRequest instance + */ + @Nonnull + public RelationRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.termstore.requests.RelationRequest(getRequestUrl(), getClient(), requestOptions); + } + + + + /** + * Gets the request builder for Term + * + * @return the TermWithReferenceRequestBuilder instance + */ + @Nonnull + public TermWithReferenceRequestBuilder fromTerm() { + return new TermWithReferenceRequestBuilder(getRequestUrlWithAdditionalSegment("fromTerm"), getClient(), null); + } + + /** + * Gets the request builder for Set + * + * @return the SetWithReferenceRequestBuilder instance + */ + @Nonnull + public SetWithReferenceRequestBuilder set() { + return new SetWithReferenceRequestBuilder(getRequestUrlWithAdditionalSegment("set"), getClient(), null); + } + + /** + * Gets the request builder for Term + * + * @return the TermWithReferenceRequestBuilder instance + */ + @Nonnull + public TermWithReferenceRequestBuilder toTerm() { + return new TermWithReferenceRequestBuilder(getRequestUrlWithAdditionalSegment("toTerm"), getClient(), null); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionPage.java b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionPage.java new file mode 100644 index 00000000000..c3fdf529db3 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionPage.java @@ -0,0 +1,40 @@ +// Template Source: BaseEntityCollectionPage.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.termstore.requests.SetCollectionResponse; +import com.microsoft.graph.http.BaseCollectionPage; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Collection Page. + */ +public class SetCollectionPage extends BaseCollectionPage { + + /** + * A collection page for Set + * + * @param response the serialized SetCollectionResponse from the service + * @param builder the request builder for the next collection page + */ + public SetCollectionPage(@Nonnull final SetCollectionResponse response, @Nonnull final SetCollectionRequestBuilder builder) { + super(response, builder); + } + + /** + * Creates the collection page for Set + * + * @param pageContents the contents of this page + * @param nextRequestBuilder the request builder for the next page + */ + public SetCollectionPage(@Nonnull final java.util.List pageContents, @Nullable final SetCollectionRequestBuilder nextRequestBuilder) { + super(pageContents, nextRequestBuilder); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequest.java new file mode 100644 index 00000000000..f221dab5d25 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequest.java @@ -0,0 +1,173 @@ +// Template Source: BaseEntityCollectionRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.models.Set; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseEntityCollectionRequest; +import com.microsoft.graph.termstore.requests.SetCollectionResponse; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetCollectionRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Collection Request. + */ +public class SetCollectionRequest extends BaseEntityCollectionRequest { + + /** + * The request builder for this collection of Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetCollectionRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, SetCollectionResponse.class, SetCollectionPage.class, SetCollectionRequestBuilder.class); + } + + /** + * Creates a new Set + * @param newSet the Set to create + * @return a future with the created object + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Set newSet) { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new SetRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .postAsync(newSet); + } + + /** + * Creates a new Set + * @param newSet the Set to create + * @return the newly created object + */ + @Nonnull + public Set post(@Nonnull final Set newSet) throws ClientException { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new SetRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .post(newSet); + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public SetCollectionRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + @Nonnull + public SetCollectionRequest filter(@Nonnull final String value) { + addFilterOption(value); + return this; + } + + /** + * Sets the order by clause for the request + * + * @param value the order by clause + * @return the updated request + */ + @Nonnull + public SetCollectionRequest orderBy(@Nonnull final String value) { + addOrderByOption(value); + return this; + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public SetCollectionRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the top value for the request + * + * @param value the max number of items to return + * @return the updated request + */ + @Nonnull + public SetCollectionRequest top(final int value) { + addTopOption(value); + return this; + } + + /** + * Sets the count value for the request + * + * @param value whether or not to return the count of objects with the request + * @return the updated request + */ + @Nonnull + public SetCollectionRequest count(final boolean value) { + addCountOption(value); + return this; + } + /** + * Sets the count value to true for the request + * + * @return the updated request + */ + @Nonnull + public SetCollectionRequest count() { + addCountOption(true); + return this; + } + /** + * Sets the skip value for the request + * + * @param value of the number of items to skip + * @return the updated request + */ + @Nonnull + public SetCollectionRequest skip(final int value) { + addSkipOption(value); + return this; + } + + + /** + * Add Skip token for pagination + * @param skipToken - Token for pagination + * @return the updated request + */ + @Nonnull + public SetCollectionRequest skipToken(@Nonnull final String skipToken) { + addSkipTokenOption(skipToken); + return this; + } +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequestBuilder.java new file mode 100644 index 00000000000..eab8be28a52 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionRequestBuilder.java @@ -0,0 +1,51 @@ +// Template Source: BaseEntityCollectionRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Group; +import com.microsoft.graph.termstore.models.Set; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetRequestBuilder; +import com.microsoft.graph.termstore.requests.SetCollectionRequest; +import com.microsoft.graph.http.BaseCollectionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.PrimitiveRequestBuilder; +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Collection Request Builder. + */ +public class SetCollectionRequestBuilder extends BaseCollectionRequestBuilder { + + /** + * The request builder for this collection of Group + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetCollectionRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, SetRequestBuilder.class, SetCollectionRequest.class); + } + + + + /** + * Gets the raw count request for the collection + * @return The raw count request for the collection + */ + @Nonnull + public PrimitiveRequestBuilder count() { + return new PrimitiveRequestBuilder(getRequestUrlWithAdditionalSegment("$count"), getClient(), null, Long.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionResponse.java b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionResponse.java new file mode 100644 index 00000000000..281494c3406 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetCollectionResponse.java @@ -0,0 +1,18 @@ +// Template Source: BaseEntityCollectionResponse.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Set; + +import com.microsoft.graph.http.BaseCollectionResponse; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Collection Response. + */ +public class SetCollectionResponse extends BaseCollectionResponse { + +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequest.java new file mode 100644 index 00000000000..8dec7b17ae4 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequest.java @@ -0,0 +1,69 @@ +// Template Source: BaseEntityReferenceRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.http.BaseReferenceRequest; +import com.microsoft.graph.http.HttpMethod; +import com.microsoft.graph.core.IBaseClient; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonObject; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Reference Request. + */ +public class SetReferenceRequest extends BaseReferenceRequest { + + /** + * The request for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetReferenceRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Set.class); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public SetReferenceRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public SetReferenceRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequestBuilder.java new file mode 100644 index 00000000000..a4f63006580 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetReferenceRequestBuilder.java @@ -0,0 +1,42 @@ + +// Template Source: BaseEntityReferenceRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.http.BaseReferenceRequestBuilder; +import com.microsoft.graph.core.IBaseClient; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Reference Request Builder. + */ +public class SetReferenceRequestBuilder extends BaseReferenceRequestBuilder { + + /** + * The request builder for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetReferenceRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, SetReferenceRequest.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/SetRequest.java new file mode 100644 index 00000000000..7f41972c40f --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetRequest.java @@ -0,0 +1,178 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Request. + */ +public class SetRequest extends BaseRequest { + + /** + * The request for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Set.class); + } + + /** + * Gets the Set from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Set from the service + * + * @return the Set from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Set get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Set delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Set with a source + * + * @param sourceSet the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Set sourceSet) { + return sendAsync(HttpMethod.PATCH, sourceSet); + } + + /** + * Patches this Set with a source + * + * @param sourceSet the source object with updates + * @return the updated Set + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Set patch(@Nonnull final Set sourceSet) throws ClientException { + return send(HttpMethod.PATCH, sourceSet); + } + + /** + * Creates a Set with a new object + * + * @param newSet the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Set newSet) { + return sendAsync(HttpMethod.POST, newSet); + } + + /** + * Creates a Set with a new object + * + * @param newSet the new object to create + * @return the created Set + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Set post(@Nonnull final Set newSet) throws ClientException { + return send(HttpMethod.POST, newSet); + } + + /** + * Creates a Set with a new object + * + * @param newSet the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Set newSet) { + return sendAsync(HttpMethod.PUT, newSet); + } + + /** + * Creates a Set with a new object + * + * @param newSet the object to create/update + * @return the created Set + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Set put(@Nonnull final Set newSet) throws ClientException { + return send(HttpMethod.PUT, newSet); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public SetRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public SetRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/SetRequestBuilder.java new file mode 100644 index 00000000000..5914bcbabf2 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetRequestBuilder.java @@ -0,0 +1,134 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set Request Builder. + */ +public class SetRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the SetRequest instance + */ + @Nonnull + public SetRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the SetRequest instance + */ + @Nonnull + public SetRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.termstore.requests.SetRequest(getRequestUrl(), getClient(), requestOptions); + } + + + /** + * Gets a request builder for the Term collection + * + * @return the collection request builder + */ + @Nonnull + public TermCollectionRequestBuilder children() { + return new TermCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("children"), getClient(), null); + } + + /** + * Gets a request builder for the Term item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public TermRequestBuilder children(@Nonnull final String id) { + return new TermRequestBuilder(getRequestUrlWithAdditionalSegment("children") + "/" + id, getClient(), null); + } + + /** + * Gets the request builder for Group + * + * @return the GroupRequestBuilder instance + */ + @Nonnull + public GroupRequestBuilder parentGroup() { + return new GroupRequestBuilder(getRequestUrlWithAdditionalSegment("parentGroup"), getClient(), null); + } + /** + * Gets a request builder for the Relation collection + * + * @return the collection request builder + */ + @Nonnull + public RelationCollectionRequestBuilder relations() { + return new RelationCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("relations"), getClient(), null); + } + + /** + * Gets a request builder for the Relation item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public RelationRequestBuilder relations(@Nonnull final String id) { + return new RelationRequestBuilder(getRequestUrlWithAdditionalSegment("relations") + "/" + id, getClient(), null); + } + /** + * Gets a request builder for the Term collection + * + * @return the collection request builder + */ + @Nonnull + public TermCollectionRequestBuilder terms() { + return new TermCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("terms"), getClient(), null); + } + + /** + * Gets a request builder for the Term item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public TermRequestBuilder terms(@Nonnull final String id) { + return new TermRequestBuilder(getRequestUrlWithAdditionalSegment("terms") + "/" + id, getClient(), null); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequest.java new file mode 100644 index 00000000000..22ea03ac2ba --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequest.java @@ -0,0 +1,68 @@ +// Template Source: BaseEntityWithReferenceRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.http.BaseWithReferenceRequest; +import com.microsoft.graph.http.HttpMethod; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.serializer.IJsonBackedObject; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set With Reference Request. + */ +public class SetWithReferenceRequest extends BaseWithReferenceRequest { + + /** + * The request for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetWithReferenceRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Set.class); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public SetWithReferenceRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public SetWithReferenceRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequestBuilder.java new file mode 100644 index 00000000000..995f65ef836 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/SetWithReferenceRequestBuilder.java @@ -0,0 +1,41 @@ +// Template Source: BaseEntityWithReferenceRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Set; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.http.BaseWithReferenceRequestBuilder; +import com.microsoft.graph.core.IBaseClient; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Set With Reference Request Builder. + */ +public class SetWithReferenceRequestBuilder extends BaseWithReferenceRequestBuilder { + + /** + * The request builder for the Set + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public SetWithReferenceRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, SetWithReferenceRequest.class, SetReferenceRequestBuilder.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionPage.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionPage.java new file mode 100644 index 00000000000..fc5ce00ae41 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionPage.java @@ -0,0 +1,40 @@ +// Template Source: BaseEntityCollectionPage.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Store; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.termstore.requests.StoreCollectionResponse; +import com.microsoft.graph.http.BaseCollectionPage; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Collection Page. + */ +public class StoreCollectionPage extends BaseCollectionPage { + + /** + * A collection page for Store + * + * @param response the serialized StoreCollectionResponse from the service + * @param builder the request builder for the next collection page + */ + public StoreCollectionPage(@Nonnull final StoreCollectionResponse response, @Nonnull final StoreCollectionRequestBuilder builder) { + super(response, builder); + } + + /** + * Creates the collection page for Store + * + * @param pageContents the contents of this page + * @param nextRequestBuilder the request builder for the next page + */ + public StoreCollectionPage(@Nonnull final java.util.List pageContents, @Nullable final StoreCollectionRequestBuilder nextRequestBuilder) { + super(pageContents, nextRequestBuilder); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequest.java new file mode 100644 index 00000000000..e102fffbe6b --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequest.java @@ -0,0 +1,173 @@ +// Template Source: BaseEntityCollectionRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.models.Site; +import com.microsoft.graph.termstore.models.Store; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseEntityCollectionRequest; +import com.microsoft.graph.termstore.requests.StoreCollectionResponse; +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Collection Request. + */ +public class StoreCollectionRequest extends BaseEntityCollectionRequest { + + /** + * The request builder for this collection of Store + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public StoreCollectionRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, StoreCollectionResponse.class, StoreCollectionPage.class, StoreCollectionRequestBuilder.class); + } + + /** + * Creates a new Store + * @param newStore the Store to create + * @return a future with the created object + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Store newStore) { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new StoreRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .postAsync(newStore); + } + + /** + * Creates a new Store + * @param newStore the Store to create + * @return the newly created object + */ + @Nonnull + public Store post(@Nonnull final Store newStore) throws ClientException { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new StoreRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .post(newStore); + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest filter(@Nonnull final String value) { + addFilterOption(value); + return this; + } + + /** + * Sets the order by clause for the request + * + * @param value the order by clause + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest orderBy(@Nonnull final String value) { + addOrderByOption(value); + return this; + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the top value for the request + * + * @param value the max number of items to return + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest top(final int value) { + addTopOption(value); + return this; + } + + /** + * Sets the count value for the request + * + * @param value whether or not to return the count of objects with the request + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest count(final boolean value) { + addCountOption(value); + return this; + } + /** + * Sets the count value to true for the request + * + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest count() { + addCountOption(true); + return this; + } + /** + * Sets the skip value for the request + * + * @param value of the number of items to skip + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest skip(final int value) { + addSkipOption(value); + return this; + } + + + /** + * Add Skip token for pagination + * @param skipToken - Token for pagination + * @return the updated request + */ + @Nonnull + public StoreCollectionRequest skipToken(@Nonnull final String skipToken) { + addSkipTokenOption(skipToken); + return this; + } +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequestBuilder.java new file mode 100644 index 00000000000..a7483b83a93 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionRequestBuilder.java @@ -0,0 +1,51 @@ +// Template Source: BaseEntityCollectionRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.models.Site; +import com.microsoft.graph.termstore.models.Store; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.termstore.requests.StoreCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreRequestBuilder; +import com.microsoft.graph.termstore.requests.StoreCollectionRequest; +import com.microsoft.graph.http.BaseCollectionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.PrimitiveRequestBuilder; +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Collection Request Builder. + */ +public class StoreCollectionRequestBuilder extends BaseCollectionRequestBuilder { + + /** + * The request builder for this collection of Site + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public StoreCollectionRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, StoreRequestBuilder.class, StoreCollectionRequest.class); + } + + + + /** + * Gets the raw count request for the collection + * @return The raw count request for the collection + */ + @Nonnull + public PrimitiveRequestBuilder count() { + return new PrimitiveRequestBuilder(getRequestUrlWithAdditionalSegment("$count"), getClient(), null, Long.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionResponse.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionResponse.java new file mode 100644 index 00000000000..4ee0b0043c2 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreCollectionResponse.java @@ -0,0 +1,18 @@ +// Template Source: BaseEntityCollectionResponse.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Store; + +import com.microsoft.graph.http.BaseCollectionResponse; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Collection Response. + */ +public class StoreCollectionResponse extends BaseCollectionResponse { + +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreRequest.java new file mode 100644 index 00000000000..7df409182a4 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreRequest.java @@ -0,0 +1,177 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Store; +import com.microsoft.graph.termstore.requests.GroupCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Request. + */ +public class StoreRequest extends BaseRequest { + + /** + * The request for the Store + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public StoreRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Store.class); + } + + /** + * Gets the Store from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Store from the service + * + * @return the Store from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Store get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Store delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Store with a source + * + * @param sourceStore the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Store sourceStore) { + return sendAsync(HttpMethod.PATCH, sourceStore); + } + + /** + * Patches this Store with a source + * + * @param sourceStore the source object with updates + * @return the updated Store + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Store patch(@Nonnull final Store sourceStore) throws ClientException { + return send(HttpMethod.PATCH, sourceStore); + } + + /** + * Creates a Store with a new object + * + * @param newStore the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Store newStore) { + return sendAsync(HttpMethod.POST, newStore); + } + + /** + * Creates a Store with a new object + * + * @param newStore the new object to create + * @return the created Store + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Store post(@Nonnull final Store newStore) throws ClientException { + return send(HttpMethod.POST, newStore); + } + + /** + * Creates a Store with a new object + * + * @param newStore the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Store newStore) { + return sendAsync(HttpMethod.PUT, newStore); + } + + /** + * Creates a Store with a new object + * + * @param newStore the object to create/update + * @return the created Store + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Store put(@Nonnull final Store newStore) throws ClientException { + return send(HttpMethod.PUT, newStore); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public StoreRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public StoreRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/StoreRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/StoreRequestBuilder.java new file mode 100644 index 00000000000..5468343bc76 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/StoreRequestBuilder.java @@ -0,0 +1,103 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Store; +import com.microsoft.graph.termstore.requests.GroupCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.GroupRequestBuilder; +import com.microsoft.graph.termstore.requests.SetCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.SetRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Store Request Builder. + */ +public class StoreRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Store + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public StoreRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the StoreRequest instance + */ + @Nonnull + public StoreRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the StoreRequest instance + */ + @Nonnull + public StoreRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.termstore.requests.StoreRequest(getRequestUrl(), getClient(), requestOptions); + } + + + /** + * Gets a request builder for the Group collection + * + * @return the collection request builder + */ + @Nonnull + public GroupCollectionRequestBuilder groups() { + return new GroupCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("groups"), getClient(), null); + } + + /** + * Gets a request builder for the Group item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public GroupRequestBuilder groups(@Nonnull final String id) { + return new GroupRequestBuilder(getRequestUrlWithAdditionalSegment("groups") + "/" + id, getClient(), null); + } + /** + * Gets a request builder for the Set collection + * + * @return the collection request builder + */ + @Nonnull + public SetCollectionRequestBuilder sets() { + return new SetCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("sets"), getClient(), null); + } + + /** + * Gets a request builder for the Set item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public SetRequestBuilder sets(@Nonnull final String id) { + return new SetRequestBuilder(getRequestUrlWithAdditionalSegment("sets") + "/" + id, getClient(), null); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionPage.java b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionPage.java new file mode 100644 index 00000000000..07c7c893348 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionPage.java @@ -0,0 +1,40 @@ +// Template Source: BaseEntityCollectionPage.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.termstore.requests.TermCollectionResponse; +import com.microsoft.graph.http.BaseCollectionPage; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Collection Page. + */ +public class TermCollectionPage extends BaseCollectionPage { + + /** + * A collection page for Term + * + * @param response the serialized TermCollectionResponse from the service + * @param builder the request builder for the next collection page + */ + public TermCollectionPage(@Nonnull final TermCollectionResponse response, @Nonnull final TermCollectionRequestBuilder builder) { + super(response, builder); + } + + /** + * Creates the collection page for Term + * + * @param pageContents the contents of this page + * @param nextRequestBuilder the request builder for the next page + */ + public TermCollectionPage(@Nonnull final java.util.List pageContents, @Nullable final TermCollectionRequestBuilder nextRequestBuilder) { + super(pageContents, nextRequestBuilder); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequest.java new file mode 100644 index 00000000000..d64e5a526dd --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequest.java @@ -0,0 +1,172 @@ +// Template Source: BaseEntityCollectionRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseEntityCollectionRequest; +import com.microsoft.graph.termstore.requests.TermCollectionResponse; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermCollectionRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Collection Request. + */ +public class TermCollectionRequest extends BaseEntityCollectionRequest { + + /** + * The request builder for this collection of Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermCollectionRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, TermCollectionResponse.class, TermCollectionPage.class, TermCollectionRequestBuilder.class); + } + + /** + * Creates a new Term + * @param newTerm the Term to create + * @return a future with the created object + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Term newTerm) { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new TermRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .postAsync(newTerm); + } + + /** + * Creates a new Term + * @param newTerm the Term to create + * @return the newly created object + */ + @Nonnull + public Term post(@Nonnull final Term newTerm) throws ClientException { + final String requestUrl = getBaseRequest().getRequestUrl().toString(); + return new TermRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null) + .buildRequest(getBaseRequest().getHeaders()) + .post(newTerm); + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public TermCollectionRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + @Nonnull + public TermCollectionRequest filter(@Nonnull final String value) { + addFilterOption(value); + return this; + } + + /** + * Sets the order by clause for the request + * + * @param value the order by clause + * @return the updated request + */ + @Nonnull + public TermCollectionRequest orderBy(@Nonnull final String value) { + addOrderByOption(value); + return this; + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public TermCollectionRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the top value for the request + * + * @param value the max number of items to return + * @return the updated request + */ + @Nonnull + public TermCollectionRequest top(final int value) { + addTopOption(value); + return this; + } + + /** + * Sets the count value for the request + * + * @param value whether or not to return the count of objects with the request + * @return the updated request + */ + @Nonnull + public TermCollectionRequest count(final boolean value) { + addCountOption(value); + return this; + } + /** + * Sets the count value to true for the request + * + * @return the updated request + */ + @Nonnull + public TermCollectionRequest count() { + addCountOption(true); + return this; + } + /** + * Sets the skip value for the request + * + * @param value of the number of items to skip + * @return the updated request + */ + @Nonnull + public TermCollectionRequest skip(final int value) { + addSkipOption(value); + return this; + } + + + /** + * Add Skip token for pagination + * @param skipToken - Token for pagination + * @return the updated request + */ + @Nonnull + public TermCollectionRequest skipToken(@Nonnull final String skipToken) { + addSkipTokenOption(skipToken); + return this; + } +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequestBuilder.java new file mode 100644 index 00000000000..29b7d38005b --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionRequestBuilder.java @@ -0,0 +1,50 @@ +// Template Source: BaseEntityCollectionRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.TermCollectionRequest; +import com.microsoft.graph.http.BaseCollectionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.PrimitiveRequestBuilder; +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Collection Request Builder. + */ +public class TermCollectionRequestBuilder extends BaseCollectionRequestBuilder { + + /** + * The request builder for this collection of Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermCollectionRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, TermRequestBuilder.class, TermCollectionRequest.class); + } + + + + /** + * Gets the raw count request for the collection + * @return The raw count request for the collection + */ + @Nonnull + public PrimitiveRequestBuilder count() { + return new PrimitiveRequestBuilder(getRequestUrlWithAdditionalSegment("$count"), getClient(), null, Long.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionResponse.java b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionResponse.java new file mode 100644 index 00000000000..4e7b0e6dd7f --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermCollectionResponse.java @@ -0,0 +1,18 @@ +// Template Source: BaseEntityCollectionResponse.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; +import com.microsoft.graph.termstore.models.Term; + +import com.microsoft.graph.http.BaseCollectionResponse; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Collection Response. + */ +public class TermCollectionResponse extends BaseCollectionResponse { + +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequest.java new file mode 100644 index 00000000000..07e0429021d --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequest.java @@ -0,0 +1,69 @@ +// Template Source: BaseEntityReferenceRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.http.BaseReferenceRequest; +import com.microsoft.graph.http.HttpMethod; +import com.microsoft.graph.core.IBaseClient; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonObject; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Reference Request. + */ +public class TermReferenceRequest extends BaseReferenceRequest { + + /** + * The request for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermReferenceRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Term.class); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public TermReferenceRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public TermReferenceRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequestBuilder.java new file mode 100644 index 00000000000..98f33161ba4 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermReferenceRequestBuilder.java @@ -0,0 +1,42 @@ + +// Template Source: BaseEntityReferenceRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.http.BaseReferenceRequestBuilder; +import com.microsoft.graph.core.IBaseClient; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Reference Request Builder. + */ +public class TermReferenceRequestBuilder extends BaseReferenceRequestBuilder { + + /** + * The request builder for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermReferenceRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, TermReferenceRequest.class); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/TermRequest.java new file mode 100644 index 00000000000..416ae10ad6f --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermRequest.java @@ -0,0 +1,178 @@ +// Template Source: BaseEntityRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Request. + */ +public class TermRequest extends BaseRequest { + + /** + * The request for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Term.class); + } + + /** + * Gets the Term from the service + * + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture getAsync() { + return sendAsync(HttpMethod.GET, null); + } + + /** + * Gets the Term from the service + * + * @return the Term from the request + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Term get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Delete this item from the service + * + * @return a future with the deletion result + */ + @Nonnull + public java.util.concurrent.CompletableFuture deleteAsync() { + return sendAsync(HttpMethod.DELETE, null); + } + + /** + * Delete this item from the service + * @return the resulting response if the service returns anything on deletion + * + * @throws ClientException if there was an exception during the delete operation + */ + @Nullable + public Term delete() throws ClientException { + return send(HttpMethod.DELETE, null); + } + + /** + * Patches this Term with a source + * + * @param sourceTerm the source object with updates + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture patchAsync(@Nonnull final Term sourceTerm) { + return sendAsync(HttpMethod.PATCH, sourceTerm); + } + + /** + * Patches this Term with a source + * + * @param sourceTerm the source object with updates + * @return the updated Term + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Term patch(@Nonnull final Term sourceTerm) throws ClientException { + return send(HttpMethod.PATCH, sourceTerm); + } + + /** + * Creates a Term with a new object + * + * @param newTerm the new object to create + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture postAsync(@Nonnull final Term newTerm) { + return sendAsync(HttpMethod.POST, newTerm); + } + + /** + * Creates a Term with a new object + * + * @param newTerm the new object to create + * @return the created Term + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Term post(@Nonnull final Term newTerm) throws ClientException { + return send(HttpMethod.POST, newTerm); + } + + /** + * Creates a Term with a new object + * + * @param newTerm the object to create/update + * @return a future with the result + */ + @Nonnull + public java.util.concurrent.CompletableFuture putAsync(@Nonnull final Term newTerm) { + return sendAsync(HttpMethod.PUT, newTerm); + } + + /** + * Creates a Term with a new object + * + * @param newTerm the object to create/update + * @return the created Term + * @throws ClientException this exception occurs if the request was unable to complete for any reason + */ + @Nullable + public Term put(@Nonnull final Term newTerm) throws ClientException { + return send(HttpMethod.PUT, newTerm); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public TermRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public TermRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } + +} + diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/TermRequestBuilder.java new file mode 100644 index 00000000000..32b60688830 --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermRequestBuilder.java @@ -0,0 +1,114 @@ +// Template Source: BaseEntityRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term Request Builder. + */ +public class TermRequestBuilder extends BaseRequestBuilder { + + /** + * The request builder for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions); + } + + /** + * Creates the request + * + * @param requestOptions the options for this request + * @return the TermRequest instance + */ + @Nonnull + public TermRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { + return buildRequest(getOptions(requestOptions)); + } + + /** + * Creates the request with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for this request + * @return the TermRequest instance + */ + @Nonnull + public TermRequest buildRequest(@Nonnull final java.util.List requestOptions) { + return new com.microsoft.graph.termstore.requests.TermRequest(getRequestUrl(), getClient(), requestOptions); + } + + + /** + * Gets a request builder for the Term collection + * + * @return the collection request builder + */ + @Nonnull + public TermCollectionRequestBuilder children() { + return new TermCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("children"), getClient(), null); + } + + /** + * Gets a request builder for the Term item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public TermRequestBuilder children(@Nonnull final String id) { + return new TermRequestBuilder(getRequestUrlWithAdditionalSegment("children") + "/" + id, getClient(), null); + } + /** + * Gets a request builder for the Relation collection + * + * @return the collection request builder + */ + @Nonnull + public RelationCollectionRequestBuilder relations() { + return new RelationCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("relations"), getClient(), null); + } + + /** + * Gets a request builder for the Relation item + * + * @return the request builder + * @param id the item identifier + */ + @Nonnull + public RelationRequestBuilder relations(@Nonnull final String id) { + return new RelationRequestBuilder(getRequestUrlWithAdditionalSegment("relations") + "/" + id, getClient(), null); + } + + /** + * Gets the request builder for Set + * + * @return the SetWithReferenceRequestBuilder instance + */ + @Nonnull + public SetWithReferenceRequestBuilder set() { + return new SetWithReferenceRequestBuilder(getRequestUrlWithAdditionalSegment("set"), getClient(), null); + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequest.java b/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequest.java new file mode 100644 index 00000000000..0d1414984ba --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequest.java @@ -0,0 +1,68 @@ +// Template Source: BaseEntityWithReferenceRequest.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.options.QueryOption; +import com.microsoft.graph.http.BaseWithReferenceRequest; +import com.microsoft.graph.http.HttpMethod; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.serializer.IJsonBackedObject; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term With Reference Request. + */ +public class TermWithReferenceRequest extends BaseWithReferenceRequest { + + /** + * The request for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermWithReferenceRequest(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, Term.class); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + @Nonnull + public TermWithReferenceRequest select(@Nonnull final String value) { + addSelectOption(value); + return this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + @Nonnull + public TermWithReferenceRequest expand(@Nonnull final String value) { + addExpandOption(value); + return this; + } +} diff --git a/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequestBuilder.java b/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequestBuilder.java new file mode 100644 index 00000000000..f712b29822c --- /dev/null +++ b/src/main/java/com/microsoft/graph/termstore/requests/TermWithReferenceRequestBuilder.java @@ -0,0 +1,41 @@ +// Template Source: BaseEntityWithReferenceRequestBuilder.java.tt +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph.termstore.requests; + +import com.microsoft.graph.http.IRequestBuilder; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.termstore.models.Term; +import com.microsoft.graph.termstore.requests.TermCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.TermRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationCollectionRequestBuilder; +import com.microsoft.graph.termstore.requests.RelationRequestBuilder; +import com.microsoft.graph.termstore.requests.SetWithReferenceRequestBuilder; +import java.util.Arrays; +import java.util.EnumSet; +import javax.annotation.Nullable; +import javax.annotation.Nonnull; + +import com.microsoft.graph.http.BaseWithReferenceRequestBuilder; +import com.microsoft.graph.core.IBaseClient; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Term With Reference Request Builder. + */ +public class TermWithReferenceRequestBuilder extends BaseWithReferenceRequestBuilder { + + /** + * The request builder for the Term + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public TermWithReferenceRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient client, @Nullable final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, TermWithReferenceRequest.class, TermReferenceRequestBuilder.class); + } +}