AddPet() public method

Add a new pet to the store
Thrown when fails to make API call
public AddPet ( Pet body ) : void
body IO.Swagger.Model.Pet Pet object that needs to be added to the store
return void
コード例 #1
0
ファイル: TestPet.cs プロジェクト: frantuma/swagger-codegen
        public void Init()
        {
            // create pet
            Pet p = createPet();

            // add pet before testing
            PetApi petApi = new PetApi("http://petstore.swagger.io/v2/");
            petApi.AddPet (p);
        }
コード例 #2
-1
ファイル: TestPet.cs プロジェクト: DariusMR/swagger-codegen
        public void Init()
        {
            // create pet
            Pet p = new Pet();
            p.Id = petId;
            p.Name = "Csharp test";
            p.Status = "available";
            // create Category object
            Category category = new Category();
            category.Id = 56;
            category.Name = "sample category name2";
            List<String> photoUrls = new List<String>(new String[] {"sample photoUrls"});
            // create Tag object
            Tag tag = new Tag();
            tag.Id = petId;
            tag.Name = "sample tag name1";
            List<Tag> tags = new List<Tag>(new Tag[] {tag});
            p.Tags = tags;
            p.Category = category;
            p.PhotoUrls = photoUrls;

            // add pet before testing
            PetApi petApi = new PetApi("http://petstore.swagger.io/v2/");
            petApi.AddPet (p);
        }