Class ModuleTags


  • public class ModuleTags
    extends java.lang.Object
    Content tags Module.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  ModuleTags.Async
      Async module.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModuleTags​(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)
      Create tags module.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ModuleTags.Async async()  
      CMATag create​(java.lang.String environmentId, java.lang.String spaceId, java.lang.String tagId, java.lang.String name, CMAVisibility visibility)
      Create an tag using the given tag id.
      protected com.contentful.java.cma.ServiceContentTags createService​(retrofit2.Retrofit retrofit)  
      java.lang.Integer delete​(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)
      Delete an tag.
      CMAArray<CMATag> fetchAll()
      Fetch all tags of the configured space.
      CMAArray<CMATag> fetchAll​(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,​java.lang.String> query)
      Fetch all tag of the given space with query
      CMATag fetchOne​(java.lang.String tagId)
      Fetch a tag with a given environmentId from the configured space.
      CMATag fetchOne​(java.lang.String spaceId, java.lang.String environmentId, java.lang.String tagId)
      Fetch a tag with a given environmentId and space.
      CMATag update​(java.lang.String name, java.lang.String tagId)
      Update a tag.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModuleTags

        public ModuleTags​(retrofit2.Retrofit retrofit,
                          java.util.concurrent.Executor callbackExecutor,
                          java.lang.String spaceId,
                          java.lang.String environmentId,
                          boolean environmentIdConfigured)
        Create tags 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.ServiceContentTags createService​(retrofit2.Retrofit retrofit)
      • create

        public CMATag create​(java.lang.String environmentId,
                             java.lang.String spaceId,
                             java.lang.String tagId,
                             java.lang.String name,
                             CMAVisibility visibility)
        Create an tag using the given tag id.

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

        Returns:
        CMATag result instance
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
      • delete

        public java.lang.Integer delete​(java.lang.String spaceId,
                                        java.lang.String environmentId,
                                        java.lang.String tagId)
        Delete an tag.
        Returns:
        Integer representing the result (204, or an error code)
        Throws:
        java.lang.IllegalArgumentException - if environment's space id is null.
        java.lang.IllegalArgumentException - if tag's id is null.
      • fetchAll

        public CMAArray<CMATag> fetchAll​(java.lang.String spaceId,
                                         java.lang.String environmentId,
                                         java.util.Map<java.lang.String,​java.lang.String> query)
        Fetch all tag of the given space with query

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

        Parameters:
        spaceId - space ID
        Returns:
        CMAArray result instance
        Throws:
        java.lang.IllegalArgumentException - if environment's space id is null.
      • fetchOne

        public CMATag fetchOne​(java.lang.String tagId)
        Fetch a tag with a given environmentId from the configured space.
        Parameters:
        tagId - tag ID
        Returns:
        CMATag result instance
        Throws:
        java.lang.IllegalArgumentException - if the configured space id is null.
        java.lang.IllegalArgumentException - if environment's id is null.
        See Also:
        CMAClient.Builder.setSpaceId(String)
      • fetchOne

        public CMATag fetchOne​(java.lang.String spaceId,
                               java.lang.String environmentId,
                               java.lang.String tagId)
        Fetch a tag with a given environmentId and space.

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

        Parameters:
        spaceId - space ID
        environmentId - environment ID
        Returns:
        CMATag result instance
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
        java.lang.IllegalArgumentException - if environment's id is null.
      • update

        public CMATag update​(java.lang.String name,
                             java.lang.String tagId)
        Update a tag.
        Returns:
        CMATag result instance
        Throws:
        java.lang.IllegalArgumentException - if tag's name is null.
        java.lang.IllegalArgumentException - if tag's id is null.
      • async

        public ModuleTags.Async async()
        Returns:
        a module with a set of asynchronous methods.