All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nutanix.dp1.mic.common.v1.response.ApiResponseMetadata Maven / Gradle / Ivy

The newest version!
/*
 * Generated file ..
 *
 * Product version: 4.0.1-beta-1
 *
 * Part of the Nutanix Microseg Versioned APIs
 *
 * (c) 2024 Nutanix Inc.  All rights reserved
 *
 */

package com.nutanix.dp1.mic.common.v1.response;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.AccessLevel;
import com.nutanix.devplatform.models.PrettyModeViews.*;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.stream.Collectors;
import com.nutanix.dp1.mic.deserializers.MicObjectTypeTypedObject;

import javax.validation.constraints.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.nutanix.dp1.mic.deserializers.MicDeserializerUtils.*;


/**
 * The metadata associated with an API response. This value is always present and minimally contains the self-link for the API request that produced this response. It also contains pagination data for the paginated requests.
 * 
 */



@Data
@lombok.extern.slf4j.Slf4j
public class ApiResponseMetadata implements java.io.Serializable, MicObjectTypeTypedObject {

  

  public ApiResponseMetadata() {

    this.$objectType = this.initialize$objectType();
    this.$reserved = new java.util.LinkedHashMap<>();
    this.$reserved.put("$fv", this.initialize$fv());
    this.$unknownFields = new java.util.LinkedHashMap<>();

  }

  @lombok.Builder(builderMethodName = "ApiResponseMetadataBuilder")
  public ApiResponseMetadata(java.util.List flags, java.util.List links, Integer totalAvailableResults, java.util.List messages, java.util.List extraInfo) {
    this.$objectType = this.initialize$objectType();
    this.$reserved = new java.util.LinkedHashMap<>();
    this.$reserved.put("$fv", this.initialize$fv());
    this.$unknownFields = new java.util.LinkedHashMap<>();

    this.setFlags(flags);

    this.setLinks(links);

    this.setTotalAvailableResults(totalAvailableResults);

    this.setMessages(messages);

    this.setExtraInfo(extraInfo);
  }


  protected String initialize$objectType() {
    return "common.v1.response.ApiResponseMetadata";
  }


  protected String initialize$fv() {
    return "v1.r0.b1";
  }

  @JsonAnySetter
  private void setUndeserializedFields(String name, String value) {
    $unknownFields.put(name, value);
  }


  
  

    
    private ApiResponseMetadataFlags flags = new ApiResponseMetadataFlags();
    
    @Data
    public static class ApiResponseMetadataFlags extends com.nutanix.dp1.mic.models.MicAbstractBoundedMap {
    
      private final String $objectType = "common.v1.response.ApiResponseMetadata.ApiResponseMetadataflags";
    
      public ApiResponseMetadataFlags() {
        super(java.lang.Boolean.class);
        init(java.util.Arrays.asList("hasError","isPaginated"), false);
      }
    
    }
    
    public java.util.List getFlags() {
      if (this.flags == null) {
        this.flags = new ApiResponseMetadataFlags();
      }
      java.util.List retVal = new java.util.LinkedList<>();
      this.flags.getKeys().forEach(key -> {
        java.lang.Boolean value = this.flags.get(key);
        com.nutanix.dp1.mic.common.v1.config.Flag item = com.nutanix.dp1.mic.common.v1.config.Flag.FlagBuilder().name(key).value(value).build();
        retVal.add(item);
      });
      return retVal;
    }
    
    public void setFlags(java.util.List flags) {
      if (this.flags == null) {
        this.flags = new ApiResponseMetadataFlags();
      }
      if (flags != null) {
        flags.forEach(item -> this.flags.put(item.getName(), item.getValue()));
      }
    }
    
    
  
  
    /**
    * An array of HATEOAS style links for the response that may also include pagination links for list operations.

    */
    
    @JsonProperty("links")
    public List links = null;
  
  

  
    /**
    * The total number of entities that are available on the server for this type.

    */
    
    @JsonProperty("totalAvailableResults")
    public Integer totalAvailableResults = null;
  
  

  
    /**
    * Information, Warning or Error messages that might provide additional contextual information related to the operation.

    */
    
    @JsonProperty("messages")
    public List messages = null;
  
  

  
    /**
    * An array of entity-specific metadata

    */
    
    @JsonProperty("extraInfo")
    public List extraInfo = null;
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final Map $reserved;
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final String $objectType;
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final Map $unknownFields;
  
  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy