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

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

/*
 * Generated file ..
 *
 * Product version: 4.0.1-alpha-1
 *
 * Part of the Nutanix Networking Versioned APIs
 *
 * (c) 2023 Nutanix Inc.  All rights reserved
 *
 */

package com.nutanix.dp1.net.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 com.nutanix.dp1.net.deserializers.NetObjectTypeTypedObject;

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.net.deserializers.NetDeserializerUtils.*;


/**
 * The metadata associated with an API response. Always present and minimally contains the self-link for the API request that produced this response.  Also contains pagination data for paginated requests.
 * 
 */



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

  

  public ApiResponseMetadata() {

    this.$objectType = this.initialize$objectType();
    this.$reserved = new java.util.LinkedHashMap<>();
    this.$reserved.put("$fqObjectType", this.initialize$fqObjectType());
    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("$fqObjectType", this.initialize$fqObjectType());
    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$fqObjectType() {
    return "common.v1.r0.a3.response.ApiResponseMetadata";
  }

  @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.net.models.NetAbstractBoundedMap {
    
      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.net.common.v1.config.Flag item = com.nutanix.dp1.net.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()));
      }
    }
    
    
  
  
    /**
    * 
    */
    
    
    @JsonProperty("links")
    public List links = null;

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

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

  
    /**
    * An array of entity-specific metadata

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

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

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy