addPet
Add a new pet to the store
/pet
                        
Usage and SDK Samples
curl -X POST "http://petstore.swagger.io/v2/pet"
                          import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
import java.io.File;
import java.util.*;
public class PetApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: petstore_auth
        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
        PetApi apiInstance = new PetApi();
        Pet pet = ; // Pet | 
        try {
            apiInstance.addPet(pet);
        } catch (ApiException e) {
            System.err.println("Exception when calling PetApi#addPet");
            e.printStackTrace();
        }
    }
}
                          import org.openapitools.client.api.PetApi;
public class PetApiExample {
    public static void main(String[] args) {
        PetApi apiInstance = new PetApi();
        Pet pet = ; // Pet | 
        try {
            apiInstance.addPet(pet);
        } catch (ApiException e) {
            System.err.println("Exception when calling PetApi#addPet");
            e.printStackTrace();
        }
    }
}
                          Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
Pet *pet = ; // 
PetApi *apiInstance = [[PetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWith:pet
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
                            var OpenApiPetstore = require('open_api_petstore');
var defaultClient = OpenApiPetstore.ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new OpenApiPetstore.PetApi()
var pet = ; // {Pet} 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.addPet(pet, callback);
                            using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
    public class addPetExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: petstore_auth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            var apiInstance = new PetApi();
            var pet = new Pet(); // Pet | 
            try
            {
                // Add a new pet to the store
                apiInstance.addPet(pet);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PetApi.addPet: " + e.Message );
            }
        }
    }
}
                            <?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new OpenAPITools\Client\Api\PetApi();
$pet = ; // Pet | 
try {
    $api_instance->addPet($pet);
} catch (Exception $e) {
    echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
}
?>
                            use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PetApi;
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::OPenAPIClient::PetApi->new();
my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | 
eval { 
    $api_instance->addPet(pet => $pet);
};
if ($@) {
    warn "Exception when calling PetApi->addPet: $@\n";
}
                            from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: petstore_auth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = openapi_client.PetApi()
pet =  # Pet | 
try: 
    # Add a new pet to the store
    api_instance.add_pet(pet)
except ApiException as e:
    print("Exception when calling PetApi->addPet: %s\n" % e)
                            extern crate PetApi;
pub fn main() {
    let pet = ; // Pet
    let mut context = PetApi::Context::default();
    let result = client.addPet(pet, &context).wait();
    println!("{:?}", result);
}
                            Scopes
| write:pets | modify pets in your account | 
| read:pets | read your pets | 
Parameters
| Name | Description | 
|---|---|
| pet * | 
 Pet object that needs to be added to the store  |