Class ArtifactsRequestBuilder

java.lang.Object
com.microsoft.kiota.BaseRequestBuilder
io.apicurio.registry.rest.client.v2.groups.item.artifacts.ArtifactsRequestBuilder

@Generated("com.microsoft.kiota") public class ArtifactsRequestBuilder extends com.microsoft.kiota.BaseRequestBuilder
Manage the collection of artifacts within a single group in the registry.
  • Constructor Details

    • ArtifactsRequestBuilder

      public ArtifactsRequestBuilder(@Nonnull HashMap<String,Object> pathParameters, @Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Instantiates a new ArtifactsRequestBuilder and sets the default values.
      Parameters:
      pathParameters - Path parameters for the request
      requestAdapter - The request adapter to use to execute the requests.
    • ArtifactsRequestBuilder

      public ArtifactsRequestBuilder(@Nonnull String rawUrl, @Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Instantiates a new ArtifactsRequestBuilder and sets the default values.
      Parameters:
      rawUrl - The raw URL to use for the request builder.
      requestAdapter - The request adapter to use to execute the requests.
  • Method Details

    • byArtifactId

      @Nonnull public WithArtifactItemRequestBuilder byArtifactId(@Nonnull String artifactId)
      Manage a single artifact.
      Parameters:
      artifactId - The artifact ID. Can be a string (client-provided) or UUID (server-generated), representing the unique artifact identifier.
      Returns:
      a WithArtifactItemRequestBuilder
    • delete

      public void delete()
      Deletes all of the artifacts that exist in a given group.
      Throws:
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      Error - When receiving a 500 status code
    • delete

      public void delete(@Nullable Consumer<ArtifactsRequestBuilder.DeleteRequestConfiguration> requestConfiguration)
      Deletes all of the artifacts that exist in a given group.
      Parameters:
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Throws:
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      Error - When receiving a 500 status code
    • get

      @Nullable public ArtifactSearchResults get()
      Returns a list of all artifacts in the group. This list is paged.
      Returns:
      a ArtifactSearchResults
      Throws:
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      Error - When receiving a 500 status code
    • get

      @Nullable public ArtifactSearchResults get(@Nullable Consumer<ArtifactsRequestBuilder.GetRequestConfiguration> requestConfiguration)
      Returns a list of all artifacts in the group. This list is paged.
      Parameters:
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a ArtifactSearchResults
      Throws:
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      Error - When receiving a 500 status code
    • post

      @Nullable public ArtifactMetaData post(@Nonnull ArtifactContent body)
      Creates a new artifact by posting the artifact content. The body of the request shouldbe the raw content of the artifact. This is typically in JSON format for *most* of the supported types, but may be in another format for a few (for example, `PROTOBUF`).The registry attempts to figure out what kind of artifact is being added from thefollowing supported list:* Avro (`AVRO`)* Protobuf (`PROTOBUF`)* JSON Schema (`JSON`)* Kafka Connect (`KCONNECT`)* OpenAPI (`OPENAPI`)* AsyncAPI (`ASYNCAPI`)* GraphQL (`GRAPHQL`)* Web Services Description Language (`WSDL`)* XML Schema (`XSD`)Alternatively, you can specify the artifact type using the `X-Registry-ArtifactType` HTTP request header, or include a hint in the request's `Content-Type`. For example:```Content-Type: application/json; artifactType=AVRO```An artifact is created using the content provided in the body of the request. Thiscontent is created under a unique artifact ID that can be provided in the requestusing the `X-Registry-ArtifactId` request header. If not provided in the request,the server generates a unique ID for the artifact. It is typically recommendedthat callers provide the ID, because this is typically a meaningful identifier, and for most use cases should be supplied by the caller.If an artifact with the provided artifact ID already exists, the default behavioris for the server to reject the content with a 409 error. However, the caller cansupply the `ifExists` query parameter to alter this default behavior. The `ifExists`query parameter can have one of the following values:* `FAIL` (*default*) - server rejects the content with a 409 error* `UPDATE` - server updates the existing artifact and returns the new metadata* `RETURN` - server does not create or add content to the server, but instead returns the metadata for the existing artifact* `RETURN_OR_UPDATE` - server returns an existing **version** that matches the provided content if such a version exists, otherwise a new version is createdThis operation may fail for one of the following reasons:* An invalid `ArtifactType` was indicated (HTTP error `400`)* No `ArtifactType` was indicated and the server could not determine one from the content (HTTP error `400`)* Provided content (request body) was empty (HTTP error `400`)* An artifact with the provided ID already exists (HTTP error `409`)* The content violates one of the configured global rules (HTTP error `409`)* A server error occurred (HTTP error `500`)
      Parameters:
      body - The request body
      Returns:
      a ArtifactMetaData
      Throws:
      Error - When receiving a 400 status code
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      RuleViolationError - When receiving a 409 status code
      Error - When receiving a 500 status code
    • post

      @Nullable public ArtifactMetaData post(@Nonnull ArtifactContent body, @Nullable Consumer<ArtifactsRequestBuilder.PostRequestConfiguration> requestConfiguration)
      Creates a new artifact by posting the artifact content. The body of the request shouldbe the raw content of the artifact. This is typically in JSON format for *most* of the supported types, but may be in another format for a few (for example, `PROTOBUF`).The registry attempts to figure out what kind of artifact is being added from thefollowing supported list:* Avro (`AVRO`)* Protobuf (`PROTOBUF`)* JSON Schema (`JSON`)* Kafka Connect (`KCONNECT`)* OpenAPI (`OPENAPI`)* AsyncAPI (`ASYNCAPI`)* GraphQL (`GRAPHQL`)* Web Services Description Language (`WSDL`)* XML Schema (`XSD`)Alternatively, you can specify the artifact type using the `X-Registry-ArtifactType` HTTP request header, or include a hint in the request's `Content-Type`. For example:```Content-Type: application/json; artifactType=AVRO```An artifact is created using the content provided in the body of the request. Thiscontent is created under a unique artifact ID that can be provided in the requestusing the `X-Registry-ArtifactId` request header. If not provided in the request,the server generates a unique ID for the artifact. It is typically recommendedthat callers provide the ID, because this is typically a meaningful identifier, and for most use cases should be supplied by the caller.If an artifact with the provided artifact ID already exists, the default behavioris for the server to reject the content with a 409 error. However, the caller cansupply the `ifExists` query parameter to alter this default behavior. The `ifExists`query parameter can have one of the following values:* `FAIL` (*default*) - server rejects the content with a 409 error* `UPDATE` - server updates the existing artifact and returns the new metadata* `RETURN` - server does not create or add content to the server, but instead returns the metadata for the existing artifact* `RETURN_OR_UPDATE` - server returns an existing **version** that matches the provided content if such a version exists, otherwise a new version is createdThis operation may fail for one of the following reasons:* An invalid `ArtifactType` was indicated (HTTP error `400`)* No `ArtifactType` was indicated and the server could not determine one from the content (HTTP error `400`)* Provided content (request body) was empty (HTTP error `400`)* An artifact with the provided ID already exists (HTTP error `409`)* The content violates one of the configured global rules (HTTP error `409`)* A server error occurred (HTTP error `500`)
      Parameters:
      body - The request body
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a ArtifactMetaData
      Throws:
      Error - When receiving a 400 status code
      AuthError - When receiving a 401 status code
      AuthError - When receiving a 403 status code
      RuleViolationError - When receiving a 409 status code
      Error - When receiving a 500 status code
    • toDeleteRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toDeleteRequestInformation()
      Deletes all of the artifacts that exist in a given group.
      Returns:
      a RequestInformation
    • toDeleteRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toDeleteRequestInformation(@Nullable Consumer<ArtifactsRequestBuilder.DeleteRequestConfiguration> requestConfiguration)
      Deletes all of the artifacts that exist in a given group.
      Parameters:
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a RequestInformation
    • toGetRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toGetRequestInformation()
      Returns a list of all artifacts in the group. This list is paged.
      Returns:
      a RequestInformation
    • toGetRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toGetRequestInformation(@Nullable Consumer<ArtifactsRequestBuilder.GetRequestConfiguration> requestConfiguration)
      Returns a list of all artifacts in the group. This list is paged.
      Parameters:
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a RequestInformation
    • toPostRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toPostRequestInformation(@Nonnull ArtifactContent body)
      Creates a new artifact by posting the artifact content. The body of the request shouldbe the raw content of the artifact. This is typically in JSON format for *most* of the supported types, but may be in another format for a few (for example, `PROTOBUF`).The registry attempts to figure out what kind of artifact is being added from thefollowing supported list:* Avro (`AVRO`)* Protobuf (`PROTOBUF`)* JSON Schema (`JSON`)* Kafka Connect (`KCONNECT`)* OpenAPI (`OPENAPI`)* AsyncAPI (`ASYNCAPI`)* GraphQL (`GRAPHQL`)* Web Services Description Language (`WSDL`)* XML Schema (`XSD`)Alternatively, you can specify the artifact type using the `X-Registry-ArtifactType` HTTP request header, or include a hint in the request's `Content-Type`. For example:```Content-Type: application/json; artifactType=AVRO```An artifact is created using the content provided in the body of the request. Thiscontent is created under a unique artifact ID that can be provided in the requestusing the `X-Registry-ArtifactId` request header. If not provided in the request,the server generates a unique ID for the artifact. It is typically recommendedthat callers provide the ID, because this is typically a meaningful identifier, and for most use cases should be supplied by the caller.If an artifact with the provided artifact ID already exists, the default behavioris for the server to reject the content with a 409 error. However, the caller cansupply the `ifExists` query parameter to alter this default behavior. The `ifExists`query parameter can have one of the following values:* `FAIL` (*default*) - server rejects the content with a 409 error* `UPDATE` - server updates the existing artifact and returns the new metadata* `RETURN` - server does not create or add content to the server, but instead returns the metadata for the existing artifact* `RETURN_OR_UPDATE` - server returns an existing **version** that matches the provided content if such a version exists, otherwise a new version is createdThis operation may fail for one of the following reasons:* An invalid `ArtifactType` was indicated (HTTP error `400`)* No `ArtifactType` was indicated and the server could not determine one from the content (HTTP error `400`)* Provided content (request body) was empty (HTTP error `400`)* An artifact with the provided ID already exists (HTTP error `409`)* The content violates one of the configured global rules (HTTP error `409`)* A server error occurred (HTTP error `500`)
      Parameters:
      body - The request body
      Returns:
      a RequestInformation
    • toPostRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toPostRequestInformation(@Nonnull ArtifactContent body, @Nullable Consumer<ArtifactsRequestBuilder.PostRequestConfiguration> requestConfiguration)
      Creates a new artifact by posting the artifact content. The body of the request shouldbe the raw content of the artifact. This is typically in JSON format for *most* of the supported types, but may be in another format for a few (for example, `PROTOBUF`).The registry attempts to figure out what kind of artifact is being added from thefollowing supported list:* Avro (`AVRO`)* Protobuf (`PROTOBUF`)* JSON Schema (`JSON`)* Kafka Connect (`KCONNECT`)* OpenAPI (`OPENAPI`)* AsyncAPI (`ASYNCAPI`)* GraphQL (`GRAPHQL`)* Web Services Description Language (`WSDL`)* XML Schema (`XSD`)Alternatively, you can specify the artifact type using the `X-Registry-ArtifactType` HTTP request header, or include a hint in the request's `Content-Type`. For example:```Content-Type: application/json; artifactType=AVRO```An artifact is created using the content provided in the body of the request. Thiscontent is created under a unique artifact ID that can be provided in the requestusing the `X-Registry-ArtifactId` request header. If not provided in the request,the server generates a unique ID for the artifact. It is typically recommendedthat callers provide the ID, because this is typically a meaningful identifier, and for most use cases should be supplied by the caller.If an artifact with the provided artifact ID already exists, the default behavioris for the server to reject the content with a 409 error. However, the caller cansupply the `ifExists` query parameter to alter this default behavior. The `ifExists`query parameter can have one of the following values:* `FAIL` (*default*) - server rejects the content with a 409 error* `UPDATE` - server updates the existing artifact and returns the new metadata* `RETURN` - server does not create or add content to the server, but instead returns the metadata for the existing artifact* `RETURN_OR_UPDATE` - server returns an existing **version** that matches the provided content if such a version exists, otherwise a new version is createdThis operation may fail for one of the following reasons:* An invalid `ArtifactType` was indicated (HTTP error `400`)* No `ArtifactType` was indicated and the server could not determine one from the content (HTTP error `400`)* Provided content (request body) was empty (HTTP error `400`)* An artifact with the provided ID already exists (HTTP error `409`)* The content violates one of the configured global rules (HTTP error `409`)* A server error occurred (HTTP error `500`)
      Parameters:
      body - The request body
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a RequestInformation
    • withUrl

      @Nonnull public ArtifactsRequestBuilder withUrl(@Nonnull String rawUrl)
      Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
      Parameters:
      rawUrl - The raw URL to use for the request builder.
      Returns:
      a ArtifactsRequestBuilder