# Pets

## Update an existing pet

`client.pets.update(PetUpdateParamsbody, RequestOptionsoptions?): Pet`

**put** `/pet`

Update an existing pet by Id

### Parameters

- `body: PetUpdateParams`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Returns

- `Pet`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pet = await client.pets.update({ name: 'doggie', photoUrls: ['string'] });

console.log(pet.id);
```

#### Response

```json
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
```

## Add a new pet to the store

`client.pets.create(PetCreateParamsbody, RequestOptionsoptions?): Pet`

**post** `/pet`

Add a new pet to the store

### Parameters

- `body: PetCreateParams`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Returns

- `Pet`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pet = await client.pets.create({ name: 'doggie', photoUrls: ['string'] });

console.log(pet.id);
```

#### Response

```json
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
```

## Finds Pets by status

`client.pets.findByStatus(PetFindByStatusParamsquery?, RequestOptionsoptions?): PetFindByStatusResponse`

**get** `/pet/findByStatus`

Multiple status values can be provided with comma separated strings

### Parameters

- `query: PetFindByStatusParams`

  - `status?: "available" | "pending" | "sold"`

    Status values that need to be considered for filter

    - `"available"`

    - `"pending"`

    - `"sold"`

### Returns

- `PetFindByStatusResponse = Array<Pet>`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pets = await client.pets.findByStatus();

console.log(pets);
```

#### Response

```json
[
  {
    "name": "doggie",
    "photoUrls": [
      "string"
    ],
    "id": 10,
    "category": {
      "id": 1,
      "name": "Dogs"
    },
    "status": "available",
    "tags": [
      {
        "id": 0,
        "name": "name"
      }
    ]
  }
]
```

## Finds Pets by tags

`client.pets.findByTags(PetFindByTagsParamsquery?, RequestOptionsoptions?): PetFindByTagsResponse`

**get** `/pet/findByTags`

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

### Parameters

- `query: PetFindByTagsParams`

  - `tags?: Array<string>`

    Tags to filter by

### Returns

- `PetFindByTagsResponse = Array<Pet>`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pets = await client.pets.findByTags();

console.log(pets);
```

#### Response

```json
[
  {
    "name": "doggie",
    "photoUrls": [
      "string"
    ],
    "id": 10,
    "category": {
      "id": 1,
      "name": "Dogs"
    },
    "status": "available",
    "tags": [
      {
        "id": 0,
        "name": "name"
      }
    ]
  }
]
```

## Find pet by ID

`client.pets.retrieve(numberpetID, RequestOptionsoptions?): Pet`

**get** `/pet/{petId}`

Returns a single pet

### Parameters

- `petID: number`

### Returns

- `Pet`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pet = await client.pets.retrieve(0);

console.log(pet.id);
```

#### Response

```json
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
```

## Updates a pet in the store with form data

`client.pets.updateByID(numberpetID, PetUpdateByIDParamsparams?, RequestOptionsoptions?): void`

**post** `/pet/{petId}`

Updates a pet in the store with form data

### Parameters

- `petID: number`

- `params: PetUpdateByIDParams`

  - `name?: string`

    Name of pet that needs to be updated

  - `status?: string`

    Status of pet that needs to be updated

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

await client.pets.updateByID(0);
```

## Deletes a pet

`client.pets.delete(numberpetID, RequestOptionsoptions?): void`

**delete** `/pet/{petId}`

delete a pet

### Parameters

- `petID: number`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

await client.pets.delete(0);
```

## uploads an image

`client.pets.uploadImage(numberpetID, "string" | "ArrayBuffer" | "ArrayBufferView" | 2 moreimage, PetUploadImageParamsparams, RequestOptionsoptions?): PetUploadImageResponse`

**post** `/pet/{petId}/uploadImage`

uploads an image

### Parameters

- `petID: number`

- `image: "string" | "ArrayBuffer" | "ArrayBufferView" | 2 more`

- `params: PetUploadImageParams`

  - `additionalMetadata?: string`

    Query param: Additional Metadata

### Returns

- `PetUploadImageResponse`

  - `code?: number`

  - `message?: string`

  - `type?: string`

### Example

```typescript
import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const response = await client.pets.uploadImage(0, fs.createReadStream('path/to/file'));

console.log(response.code);
```

#### Response

```json
{
  "code": 0,
  "message": "message",
  "type": "type"
}
```

## Domain Types

### Category

- `Category`

  - `id?: number`

  - `name?: string`

### Pet

- `Pet`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Tag

- `Tag`

  - `id?: number`

  - `name?: string`

### Pet Find By Status Response

- `PetFindByStatusResponse = Array<Pet>`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Pet Find By Tags Response

- `PetFindByTagsResponse = Array<Pet>`

  - `name: string`

  - `photoUrls: Array<string>`

  - `id?: number`

  - `category?: Category`

    - `id?: number`

    - `name?: string`

  - `status?: "available" | "pending" | "sold"`

    pet status in the store

    - `"available"`

    - `"pending"`

    - `"sold"`

  - `tags?: Array<Tag>`

    - `id?: number`

    - `name?: string`

### Pet Upload Image Response

- `PetUploadImageResponse`

  - `code?: number`

  - `message?: string`

  - `type?: string`
