Class TokenResponse

java.lang.Object
pro.mypvit.responses.AbstractResponse
pro.mypvit.responses.TokenResponse

public class TokenResponse extends AbstractResponse
Represents the response for a token generation request in the MyPVit SDK.

This class extends AbstractResponse to inherit functionality for JSON deserialization and provides specific fields related to token generation status.

Key Features:
  • Inherits JSON deserialization capabilities from AbstractResponse.
  • Includes fields for the status code and message returned by the token generation API.
  • Supports automatic generation of getters, setters, equals, and hashCode methods through Lombok.
Usage: Use the `fromJson` method provided by AbstractResponse to deserialize a JSON response into an instance of this class. Example:
 String jsonResponse = "{"
     + "\"status_code\": \"200\","
     + "\"message\": \"Token generated successfully\""
     + "}";

 TokenResponse response = AbstractResponse.fromJson(jsonResponse, TokenResponse.class);
 System.out.println("Status Code: " + response.getStatusCode());
 System.out.println("Message: " + response.getMessage());
 
  • Constructor Details

    • TokenResponse

      public TokenResponse()
      Default constructor