Package org.azd.build.definitions
Class DefinitionsRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.build.definitions.DefinitionsRequestBuilder
Provides functionality to work with Build Definitions Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the query parameter for Create Definition.static class
static class
static class
static class
static class
static class
Represents the query parameter for Create Definition.static class
Nested classes/interfaces inherited from class org.azd.abstractions.BaseRequestBuilder
BaseRequestBuilder.ProjectExcludeParameter
-
Field Summary
Fields inherited from class org.azd.abstractions.BaseRequestBuilder
accessTokenCredential, apiVersion, area, locationId, organizationUrl, serializer
-
Constructor Summary
ConstructorDescriptionDefinitionsRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.DefinitionRequestConfiguration> definitionRequestConfiguration) Creates a new definition.createAsync
(BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.DefinitionRequestConfiguration> definitionRequestConfiguration) Creates a new definition.delete
(int definitionId) Deletes a definition and all associated builds.deleteAsync
(int definitionId) Deletes a definition and all associated builds.get
(int definitionId) Gets a definitionget
(int definitionId, Consumer<DefinitionsRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets a definitiongetAsync
(int definitionId) Gets a definitiongetAsync
(int definitionId, Consumer<DefinitionsRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets a definitiongetRevisions
(int definitionId) Gets a definition revisions.getRevisionsAsync
(int definitionId) Gets a definition revisions.list()
Gets a list of definitions.list
(Consumer<DefinitionsRequestBuilder.ListRequestConfiguration> requestConfiguration) Gets a list of definitions.Gets a list of definitions.listAsync
(Consumer<DefinitionsRequestBuilder.ListRequestConfiguration> requestConfiguration) Gets a list of definitions.restore
(int definitionId, boolean deleted) Restores a deleted definitionrestoreAsync
(int definitionId, boolean deleted) Restores a deleted definitionupdate
(int definitionId, BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.UpdateRequestConfiguration> requestConfiguration) Updates an existing build definition.updateAsync
(int definitionId, BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.UpdateRequestConfiguration> requestConfiguration) Updates an existing build definition.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
DefinitionsRequestBuilder
public DefinitionsRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values.- Parameters:
organizationUrl
- Represents organization location request url.accessTokenCredential
- Access token credential object.
-
-
Method Details
-
createAsync
public CompletableFuture<BuildDefinition> createAsync(BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.DefinitionRequestConfiguration> definitionRequestConfiguration) throws AzDException Creates a new definition.- Parameters:
buildDefinition
- Build definition object.definitionRequestConfiguration
- Consumer of query parameters to clone the definition if exists.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
deleteAsync
Deletes a definition and all associated builds.- Parameters:
definitionId
- pass the definition id- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
public CompletableFuture<BuildDefinition> getAsync(int definitionId, Consumer<DefinitionsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Gets a definition- Parameters:
definitionId
- pass the definition idrequestConfiguration
- Consumer of query request parameters.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
Gets a definition- Parameters:
definitionId
- pass the definition id.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getRevisionsAsync
public CompletableFuture<BuildDefinitionRevisions> getRevisionsAsync(int definitionId) throws AzDException Gets a definition revisions.- Parameters:
definitionId
- pass the definition id- Returns:
- build definition revisions object
BuildDefinitionRevisions
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
Gets a list of definitions.- Returns:
- build definitions object
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
public CompletableFuture<BuildDefinitions> listAsync(Consumer<DefinitionsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException Gets a list of definitions.- Parameters:
requestConfiguration
- Consumer of query request parameters.- Returns:
- build definitions object
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
restoreAsync
public CompletableFuture<BuildDefinition> restoreAsync(int definitionId, boolean deleted) throws AzDException Restores a deleted definition- Parameters:
definitionId
- pass the build definition iddeleted
- When false, restores a deleted definition.- Returns:
- a
BuildDefinition
object - Throws:
AzDException
- Default Api Exception handler.
-
updateAsync
public CompletableFuture<BuildDefinition> updateAsync(int definitionId, BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.UpdateRequestConfiguration> requestConfiguration) throws AzDException Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.- Parameters:
definitionId
- pass the build definition idbuildDefinition
- Build definition object to update.- Returns:
- a
BuildDefinition
object - Throws:
AzDException
- Default Api Exception handler.
-
create
public BuildDefinition create(BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.DefinitionRequestConfiguration> definitionRequestConfiguration) throws AzDException Creates a new definition.- Parameters:
buildDefinition
- Build definition object.definitionRequestConfiguration
- Consumer of query parameters to clone the definition if exists.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
delete
Deletes a definition and all associated builds.- Parameters:
definitionId
- pass the definition id- Throws:
AzDException
- Default Api Exception handler.
-
get
public BuildDefinition get(int definitionId, Consumer<DefinitionsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Gets a definition- Parameters:
definitionId
- pass the definition idrequestConfiguration
- Consumer of query request parameters.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
get
Gets a definition- Parameters:
definitionId
- pass the definition id.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getRevisions
Gets a definition revisions.- Parameters:
definitionId
- pass the definition id- Returns:
- build definition revisions object
BuildDefinitionRevisions
- Throws:
AzDException
- Default Api Exception handler.
-
list
Gets a list of definitions.- Returns:
- build definitions object
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
list
public BuildDefinitions list(Consumer<DefinitionsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException Gets a list of definitions.- Parameters:
requestConfiguration
- Consumer of query request parameters.- Returns:
- build definitions object
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
restore
Restores a deleted definition- Parameters:
definitionId
- pass the build definition iddeleted
- When false, restores a deleted definition.- Returns:
- a
BuildDefinition
object - Throws:
AzDException
- Default Api Exception handler.
-
update
public BuildDefinition update(int definitionId, BuildDefinition buildDefinition, Consumer<DefinitionsRequestBuilder.UpdateRequestConfiguration> requestConfiguration) throws AzDException Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.- Parameters:
definitionId
- pass the build definition idbuildDefinition
- Build definition object to update.- Returns:
- a
BuildDefinition
object - Throws:
AzDException
- Default Api Exception handler.
-