Class ModuleUiExtensions


  • public class ModuleUiExtensions
    extends java.lang.Object
    Ui Extensions Module.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModuleUiExtensions​(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)
      Create this module.
    • Constructor Detail

      • ModuleUiExtensions

        public ModuleUiExtensions​(retrofit2.Retrofit retrofit,
                                  java.util.concurrent.Executor callbackExecutor,
                                  java.lang.String spaceId,
                                  java.lang.String environmentId,
                                  boolean environmentIdConfigured)
        Create this module.
        Parameters:
        retrofit - the retrofit instance to be used to create the service.
        callbackExecutor - to tell on which thread it should run.
        spaceId - the space to be used when not given.
        environmentId - the environment to be used when not given.
        environmentIdConfigured - internal helper to see if environment was set.
    • Method Detail

      • createService

        protected com.contentful.java.cma.ServiceUiExtensions createService​(retrofit2.Retrofit retrofit)
      • fetchOne

        public CMAUiExtension fetchOne​(java.lang.String extensionId)
        Fetch one ui extension from the configured space and environment.
        Parameters:
        extensionId - the id of the extension to be fetched.
        Returns:
        the ui extension for a specific space.
        Throws:
        java.lang.IllegalArgumentException - if extensionId is null.
        java.lang.IllegalArgumentException - if configured space id is null.
        java.lang.IllegalArgumentException - if configured environment id is null.
        See Also:
        CMAClient.Builder.setSpaceId(String), CMAClient.Builder.setEnvironmentId(String)
      • fetchOne

        public CMAUiExtension fetchOne​(java.lang.String spaceId,
                                       java.lang.String environmentId,
                                       java.lang.String extensionId)
        Fetch one extension from the given space.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String) and will ignore CMAClient.Builder.setEnvironmentId(String).

        Parameters:
        spaceId - the id of the space this is valid on.
        environmentId - the id of the environment this is valid on.
        extensionId - the id of the extension to be fetched.
        Returns:
        the ui extension for a specific space.
        Throws:
        java.lang.IllegalArgumentException - if spaceId is null.
        java.lang.IllegalArgumentException - if environmentId is null.
        java.lang.IllegalArgumentException - if extensionId is null.
        CMANotWithEnvironmentsException - if environmentId was set using CMAClient.Builder.setEnvironmentId(String).
      • fetchAll

        public CMAArray<CMAUiExtension> fetchAll​(java.util.Map<java.lang.String,​java.lang.String> query)
        Fetch all ui extensions from the configured space by a query.
        Parameters:
        query - controls what to return.
        Returns:
        specific ui extensions for a specific space.
        Throws:
        java.lang.IllegalArgumentException - if configured space id is null.
        java.lang.IllegalArgumentException - if configured environment id is null.
        See Also:
        CMAClient.Builder.setSpaceId(String), CMAClient.Builder.setEnvironmentId(String)
      • fetchAll

        public CMAArray<CMAUiExtension> fetchAll​(java.lang.String spaceId,
                                                 java.lang.String environmentId)
        Fetch ui extensions from a given space. CMAClient.Builder.setSpaceId(String) and will ignore CMAClient.Builder.setEnvironmentId(String).
        Parameters:
        spaceId - the id of the space this is valid on.
        environmentId - the id of the environment this is valid on.
        Returns:
        all the ui extensions for a specific space.
        Throws:
        java.lang.IllegalArgumentException - if spaceId is null.
        java.lang.IllegalArgumentException - if environmentId is null.
      • fetchAll

        public CMAArray<CMAUiExtension> fetchAll​(java.lang.String spaceId,
                                                 java.lang.String environmentId,
                                                 java.util.Map<java.lang.String,​java.lang.String> query)
        Fetch all ui extensions from a given space.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String) and will ignore CMAClient.Builder.setEnvironmentId(String).

        Parameters:
        spaceId - the id of the space this is valid on.
        environmentId - the id of the environment this is valid on.
        query - controls what to return.
        Returns:
        specific ui extensions for a specific space.
        Throws:
        java.lang.IllegalArgumentException - if spaceId is null.
        java.lang.IllegalArgumentException - if environment id is null.
      • update

        public CMAUiExtension update​(CMAUiExtension extension)
        Update a ui extension.
        Parameters:
        extension - the ui extension to be updated.
        Returns:
        the updated ui extension.
        Throws:
        java.lang.IllegalArgumentException - if extension is null.
        java.lang.IllegalArgumentException - if extension's version is null.
        java.lang.IllegalArgumentException - if extension's id is null.
        java.lang.IllegalArgumentException - if extension's spaceId is null.
        java.lang.IllegalArgumentException - if extension's environment is null.
      • delete

        public java.lang.Integer delete​(CMAUiExtension extension)
        Delete a ui extension.
        Parameters:
        extension - the extension to be deleted.
        Returns:
        the http code of the action.
        Throws:
        java.lang.IllegalArgumentException - if extension is null.
        java.lang.IllegalArgumentException - if extension's id is null.
        java.lang.IllegalArgumentException - if extension's version is null.
        java.lang.IllegalArgumentException - if extension's spaceId is null.
      • create

        public CMAUiExtension create​(CMAUiExtension extension)
        Create a new ui extension.
        Parameters:
        extension - the ui extension to be added.
        Returns:
        the created ui extension.
        Throws:
        java.lang.IllegalArgumentException - if configured spaceId is null.
        java.lang.IllegalArgumentException - if configured environmentId is null.
        java.lang.IllegalArgumentException - if extension is null.
        java.lang.IllegalArgumentException - if extension's id is null.
        java.lang.IllegalArgumentException - if extension's version is null.
        See Also:
        CMAClient.Builder.setSpaceId(String), CMAClient.Builder.setEnvironmentId(String)
      • create

        public CMAUiExtension create​(java.lang.String spaceId,
                                     java.lang.String environmentId,
                                     CMAUiExtension extension)
        Create a new ui extension.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String) and will ignore CMAClient.Builder.setEnvironmentId(String).

        Parameters:
        spaceId - the id of the space this ui extension should be created in.
        environmentId - the id of the environment this is valid on.
        extension - the ui extension to be added.
        Returns:
        the created ui extension.
        Throws:
        java.lang.IllegalArgumentException - if spaceId is null.
        java.lang.IllegalArgumentException - if extension is null.
        java.lang.IllegalArgumentException - if extension's id is null.
        java.lang.IllegalArgumentException - if extension's version is null.
        java.lang.IllegalArgumentException - if extension's spaceId is null.