Class PostStatusApiClientModule

java.lang.Object
io.github.evisentin.wordpress.client.adapter.apache.modules.PostStatusApiClientModule
All Implemented Interfaces:
PostStatusAPIs

public class PostStatusApiClientModule extends Object implements PostStatusAPIs
Apache HttpClient implementation of PostStatusAPIs.

Provides access to WordPress post status definitions through the /wp/v2/statuses endpoint.

  • Constructor Details

    • PostStatusApiClientModule

      public PostStatusApiClientModule(@NonNull @NonNull String apiUrl, @NonNull @NonNull org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, @NonNull @NonNull com.fasterxml.jackson.databind.ObjectMapper mapper)
  • Method Details

    • get

      public WpStatus get(@NonNull @NonNull String name)
      Description copied from interface: PostStatusAPIs
      Retrieves a post status definition by its unique slug.

      Examples include publish, draft, pending, future, and private.

      Specified by:
      get in interface PostStatusAPIs
      Parameters:
      name - the status slug; must not be null
      Returns:
      the matching WpStatus
    • list

      public Map<String,WpStatus> list()
      Description copied from interface: PostStatusAPIs
      Retrieves all registered post statuses.

      The returned map is keyed by status slug and contains the corresponding WpStatus definitions.

      Specified by:
      list in interface PostStatusAPIs
      Returns:
      a map of status slugs to status definitions