1
0
mirror of synced 2024-11-25 05:06:02 +03:00

JMSSerializer models, removed everything related to autodoc

This commit is contained in:
Pavel 2019-06-20 17:26:22 +03:00
parent 66a4fb6579
commit ec3bd1b293
55 changed files with 6300 additions and 2257 deletions

View File

@ -12,13 +12,4 @@ before_script:
- flags="-o" - flags="-o"
- composer install $flags - composer install $flags
script: make travis script: make test
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: mg-bot-api-client-php.pages
keep_history: true
on:
branch: master

View File

@ -22,22 +22,3 @@ stan:
@echo "==> Running analysis" @echo "==> Running analysis"
@php $(BIN_DIR)/phpstan analyse -l 4 -c $(ROOT_DIR)/phpstan.neon $(SRC_DIR) @php $(BIN_DIR)/phpstan analyse -l 4 -c $(ROOT_DIR)/phpstan.neon $(SRC_DIR)
@echo "==> Analysis complete" @echo "==> Analysis complete"
docs:
@echo "==> Building docs"
ifeq ($(wildcard *.phar), )
@wget https://github.com/phpDocumentor/phpDocumentor2/releases/download/v3.0.0-alpha.3/phpDocumentor.phar -O phpDocumentor.phar
@wget https://github.com/phpDocumentor/phpDocumentor2/releases/download/v3.0.0-alpha.3/phpDocumentor.phar.pubkey -O phpDocumentor.phar.pubkey
@chmod +x phpDocumentor.phar
endif
ifeq (, $(shell which dot))
ifeq ($(wildcard dot/dot), )
@mkdir -p $(ROOT_DIR)/dot
@wget https://github.com/Neur0toxine/mwgraphviz/raw/master/dot_static -O $(ROOT_DIR)/dot/dot
@chmod +x $(ROOT_DIR)/dot/dot
endif
endif
@php phpDocumentor.phar --config $(ROOT_DIR)/phpdoc.dist.xml
travis: test docs
@echo "==> Done."

View File

@ -12,21 +12,21 @@
} }
], ],
"require": { "require": {
"php": ">=7.1", "php": ">=7.0",
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*", "ext-json": "*",
"doctrine/cache": "1.6.*", "jms/serializer": "1.13.*",
"guzzlehttp/guzzle": "6.3.*", "symfony/validator": "^4.2",
"lazyjsonmapper/lazyjsonmapper": "^1.6", "doctrine/annotations": "^1.6",
"symfony/validator": "3.4.*", "doctrine/cache": "^1.8",
"doctrine/annotations": "1.6.*", "guzzlehttp/guzzle": "6.3.*"
"symfony/dotenv": "3.4.*"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "6.5.*", "phpunit/phpunit": "6.5.*",
"phpmd/phpmd": "2.6.*", "phpmd/phpmd": "2.6.*",
"phpstan/phpstan": "0.9.*", "phpstan/phpstan": "0.9.*",
"squizlabs/php_codesniffer": "3.4.*", "squizlabs/php_codesniffer": "3.4.*",
"symfony/dotenv": "^4.2",
"friendsofphp/php-cs-fixer": "^2.14" "friendsofphp/php-cs-fixer": "^2.14"
}, },
"support": { "support": {
@ -47,7 +47,5 @@
"config": { "config": {
"bin-dir": "bin", "bin-dir": "bin",
"process-timeout": 600 "process-timeout": 600
}, }
"minimum-stability": "dev",
"prefer-stable": true
} }

756
composer.lock generated
View File

@ -4,50 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "37c04715365723f98332d71aa2ee402e", "content-hash": "881d5b814546ed880206e10657ac877b",
"packages": [ "packages": [
{
"name": "corneltek/getoptionkit",
"version": "2.6.0",
"source": {
"type": "git",
"url": "https://github.com/c9s/GetOptionKit.git",
"reference": "995607ddf4fc90ebdb4a7d58fe972d581ad8495f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/c9s/GetOptionKit/zipball/995607ddf4fc90ebdb4a7d58fe972d581ad8495f",
"reference": "995607ddf4fc90ebdb4a7d58fe972d581ad8495f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6.x-dev"
}
},
"autoload": {
"psr-4": {
"GetOptionKit\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Yo-An Lin",
"email": "yoanlin93@gmail.com"
}
],
"description": "Powerful command-line option toolkit",
"homepage": "http://github.com/c9s/GetOptionKit",
"time": "2017-06-30T14:54:48+00:00"
},
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
"version": "v1.6.1", "version": "v1.6.1",
@ -118,33 +76,38 @@
}, },
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
"version": "v1.6.2", "version": "v1.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/cache.git", "url": "https://github.com/doctrine/cache.git",
"reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57",
"reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "~5.5|~7.0" "php": "~7.1"
}, },
"conflict": { "conflict": {
"doctrine/common": ">2.2,<2.4" "doctrine/common": ">2.2,<2.4"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.8|~5.0", "alcaeus/mongo-php-adapter": "^1.1",
"predis/predis": "~1.0", "doctrine/coding-standard": "^4.0",
"satooshi/php-coveralls": "~0.6" "mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.0",
"predis/predis": "~1.0"
},
"suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.6.x-dev" "dev-master": "1.8.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -179,33 +142,86 @@
} }
], ],
"description": "Caching library offering an object-oriented API for many cache backends", "description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org", "homepage": "https://www.doctrine-project.org",
"keywords": [ "keywords": [
"cache", "cache",
"caching" "caching"
], ],
"time": "2017-07-22T12:49:21+00:00" "time": "2018-08-21T18:01:43+00:00"
}, },
{ {
"name": "doctrine/lexer", "name": "doctrine/instantiator",
"version": "1.0.2", "version": "1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/lexer.git", "url": "https://github.com/doctrine/instantiator.git",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" "reference": "a2c590166b2133a4633738648b6b064edae0814a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "reference": "a2c590166b2133a4633738648b6b064edae0814a",
"shasum": ""
},
"require": {
"php": "^7.1"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.13",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
"time": "2019-03-17T17:37:11+00:00"
},
{
"name": "doctrine/lexer",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
}, },
"require-dev": {
"phpunit/phpunit": "^4.5"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -213,8 +229,8 @@
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" "Doctrine\\Common\\Lexer\\": "lib/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -235,16 +251,13 @@
"email": "schmittjoh@gmail.com" "email": "schmittjoh@gmail.com"
} }
], ],
"description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "https://www.doctrine-project.org/projects/lexer.html", "homepage": "http://www.doctrine-project.org",
"keywords": [ "keywords": [
"annotations",
"docblock",
"lexer", "lexer",
"parser", "parser"
"php"
], ],
"time": "2019-06-08T11:03:04+00:00" "time": "2014-09-09T13:34:57+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -430,54 +443,276 @@
"time": "2018-12-04T20:46:45+00:00" "time": "2018-12-04T20:46:45+00:00"
}, },
{ {
"name": "lazyjsonmapper/lazyjsonmapper", "name": "jms/metadata",
"version": "v1.6.3", "version": "1.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/lazyjsonmapper/lazyjsonmapper.git", "url": "https://github.com/schmittjoh/metadata.git",
"reference": "51e093b50f4de15d2d64548b3ca743713eed6ee9" "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/lazyjsonmapper/lazyjsonmapper/zipball/51e093b50f4de15d2d64548b3ca743713eed6ee9", "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8",
"reference": "51e093b50f4de15d2d64548b3ca743713eed6ee9", "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"corneltek/getoptionkit": "2.*", "php": ">=5.3.0"
"php": ">=5.6"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.7.1", "doctrine/cache": "~1.0",
"phpunit/phpunit": "6.*" "symfony/cache": "~3.1"
}, },
"bin": [
"bin/lazydoctor"
],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-0": {
"LazyJsonMapper\\": "src/" "Metadata\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"Apache-2.0" "MIT"
], ],
"authors": [ "authors": [
{ {
"name": "SteveJobzniak", "name": "Asmir Mustafic",
"homepage": "https://github.com/SteveJobzniak", "email": "goetas@gmail.com"
"role": "Developer" },
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
} }
], ],
"description": "Advanced, intelligent & automatic object-oriented JSON containers for PHP.", "description": "Class/method/property metadata management in PHP",
"homepage": "https://github.com/SteveJobzniak/LazyJsonMapper",
"keywords": [ "keywords": [
"development", "annotations",
"json" "metadata",
"xml",
"yaml"
], ],
"time": "2018-05-02T16:57:09+00:00" "time": "2018-10-26T12:40:10+00:00"
},
{
"name": "jms/parser-lib",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/parser-lib.git",
"reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d",
"reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d",
"shasum": ""
},
"require": {
"phpoption/phpoption": ">=0.9,<2.0-dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-0": {
"JMS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"description": "A library for easily creating recursive-descent parsers.",
"time": "2012-11-18T18:08:43+00:00"
},
{
"name": "jms/serializer",
"version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/serializer.git",
"reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c",
"reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1.0",
"doctrine/instantiator": "^1.0.3",
"jms/metadata": "^1.3",
"jms/parser-lib": "1.*",
"php": "^5.5|^7.0",
"phpcollection/phpcollection": "~0.1",
"phpoption/phpoption": "^1.1"
},
"conflict": {
"twig/twig": "<1.12"
},
"require-dev": {
"doctrine/orm": "~2.1",
"doctrine/phpcr-odm": "^1.3|^2.0",
"ext-pdo_sqlite": "*",
"jackalope/jackalope-doctrine-dbal": "^1.1.5",
"phpunit/phpunit": "^4.8|^5.0",
"propel/propel1": "~1.7",
"psr/container": "^1.0",
"symfony/dependency-injection": "^2.7|^3.3|^4.0",
"symfony/expression-language": "^2.6|^3.0",
"symfony/filesystem": "^2.1",
"symfony/form": "~2.1|^3.0",
"symfony/translation": "^2.1|^3.0",
"symfony/validator": "^2.2|^3.0",
"symfony/yaml": "^2.1|^3.0",
"twig/twig": "~1.12|~2.0"
},
"suggest": {
"doctrine/cache": "Required if you like to use cache functionality.",
"doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.",
"symfony/yaml": "Required if you'd like to serialize data to YAML format."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-1.x": "1.13-dev"
}
},
"autoload": {
"psr-0": {
"JMS\\Serializer": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
},
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
"homepage": "http://jmsyst.com/libs/serializer",
"keywords": [
"deserialization",
"jaxb",
"json",
"serialization",
"xml"
],
"time": "2018-07-25T13:58:54+00:00"
},
{
"name": "phpcollection/phpcollection",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-collection.git",
"reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
"reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6",
"shasum": ""
},
"require": {
"phpoption/phpoption": "1.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.4-dev"
}
},
"autoload": {
"psr-0": {
"PhpCollection": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "General-Purpose Collection Library for PHP",
"keywords": [
"collection",
"list",
"map",
"sequence",
"set"
],
"time": "2015-05-17T12:39:23+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed",
"reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.7.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-0": {
"PhpOption\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"time": "2015-07-25T16:39:46+00:00"
}, },
{ {
"name": "psr/http-message", "name": "psr/http-message",
@ -571,47 +806,36 @@
}, },
{ {
"name": "symfony/contracts", "name": "symfony/contracts",
"version": "v1.1.3", "version": "v1.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/contracts.git", "url": "https://github.com/symfony/contracts.git",
"reference": "2d19b12caccbd80cf0c85624dc87b7021a0df1d5" "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/contracts/zipball/2d19b12caccbd80cf0c85624dc87b7021a0df1d5", "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"reference": "2d19b12caccbd80cf0c85624dc87b7021a0df1d5", "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3" "php": "^7.1.3"
}, },
"replace": {
"symfony/cache-contracts": "self.version",
"symfony/event-dispatcher-contracts": "self.version",
"symfony/http-client-contracts": "self.version",
"symfony/service-contracts": "self.version",
"symfony/translation-contracts": "self.version"
},
"require-dev": { "require-dev": {
"psr/cache": "^1.0", "psr/cache": "^1.0",
"psr/container": "^1.0", "psr/container": "^1.0"
"symfony/polyfill-intl-idn": "^1.10"
}, },
"suggest": { "suggest": {
"psr/cache": "When using the Cache contracts", "psr/cache": "When using the Cache contracts",
"psr/container": "When using the Service contracts", "psr/container": "When using the Service contracts",
"psr/event-dispatcher": "When using the EventDispatcher contracts", "symfony/cache-contracts-implementation": "",
"symfony/cache-implementation": "", "symfony/service-contracts-implementation": "",
"symfony/event-dispatcher-implementation": "", "symfony/translation-contracts-implementation": ""
"symfony/http-client-implementation": "",
"symfony/service-implementation": "",
"symfony/translation-implementation": ""
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.1-dev" "dev-master": "1.0-dev"
} }
}, },
"autoload": { "autoload": {
@ -646,64 +870,7 @@
"interoperability", "interoperability",
"standards" "standards"
], ],
"time": "2019-06-05T13:28:50+00:00" "time": "2018-12-05T08:06:11+00:00"
},
{
"name": "symfony/dotenv",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/dotenv.git",
"reference": "7b33c7b6f497898a173e4b9d6a7698cd789d54ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dotenv/zipball/7b33c7b6f497898a173e4b9d6a7698cd789d54ce",
"reference": "7b33c7b6f497898a173e4b9d6a7698cd789d54ce",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"require-dev": {
"symfony/process": "~3.2|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Dotenv\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Registers environment variables from a .env file",
"homepage": "https://symfony.com",
"keywords": [
"dotenv",
"env",
"environment"
],
"time": "2019-04-01T07:08:40+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@ -823,120 +990,47 @@
"time": "2019-02-06T07:57:58+00:00" "time": "2019-02-06T07:57:58+00:00"
}, },
{ {
"name": "symfony/translation", "name": "symfony/validator",
"version": "v4.3.1", "version": "v4.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/validator.git",
"reference": "5dda505e5f65d759741dfaf4e54b36010a4b57aa" "reference": "db5457ed88aacc1a040d4961ee52cddad3e5a4aa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/5dda505e5f65d759741dfaf4e54b36010a4b57aa", "url": "https://api.github.com/repos/symfony/validator/zipball/db5457ed88aacc1a040d4961ee52cddad3e5a4aa",
"reference": "5dda505e5f65d759741dfaf4e54b36010a4b57aa", "reference": "db5457ed88aacc1a040d4961ee52cddad3e5a4aa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.1.3",
"symfony/polyfill-mbstring": "~1.0", "symfony/contracts": "^1.0.2",
"symfony/translation-contracts": "^1.1.2"
},
"conflict": {
"symfony/config": "<3.4",
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
"provide": {
"symfony/translation-implementation": "1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"symfony/http-kernel": "~3.4|~4.0",
"symfony/intl": "~3.4|~4.0",
"symfony/service-contracts": "^1.1.2",
"symfony/var-dumper": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2019-06-03T20:27:40+00:00"
},
{
"name": "symfony/validator",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/validator.git",
"reference": "23cf394faaffb6257f5764fbfc2db12ec30956f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/validator/zipball/23cf394faaffb6257f5764fbfc2db12ec30956f1",
"reference": "23cf394faaffb6257f5764fbfc2db12ec30956f1",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8",
"symfony/polyfill-ctype": "~1.8", "symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-mbstring": "~1.0"
"symfony/translation": "~2.8|~3.0|~4.0"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/dependency-injection": "<3.3", "symfony/dependency-injection": "<3.4",
"symfony/http-kernel": "<3.3.5", "symfony/http-kernel": "<3.4",
"symfony/intl": "<4.1",
"symfony/translation": "<4.2",
"symfony/yaml": "<3.4" "symfony/yaml": "<3.4"
}, },
"require-dev": { "require-dev": {
"doctrine/annotations": "~1.0", "doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0", "doctrine/cache": "~1.0",
"egulias/email-validator": "^1.2.8|~2.0", "egulias/email-validator": "^1.2.8|~2.0",
"symfony/cache": "~3.1|~4.0", "symfony/cache": "~3.4|~4.0",
"symfony/config": "~2.8|~3.0|~4.0", "symfony/config": "~3.4|~4.0",
"symfony/dependency-injection": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0", "symfony/expression-language": "~3.4|~4.0",
"symfony/http-foundation": "~2.8|~3.0|~4.0", "symfony/http-foundation": "~4.1",
"symfony/http-kernel": "^3.3.5|~4.0", "symfony/http-kernel": "~3.4|~4.0",
"symfony/intl": "^2.8.18|^3.2.5|~4.0", "symfony/intl": "~4.1",
"symfony/property-access": "~2.8|~3.0|~4.0", "symfony/property-access": "~3.4|~4.0",
"symfony/var-dumper": "~3.3|~4.0", "symfony/translation": "~4.2",
"symfony/var-dumper": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0" "symfony/yaml": "~3.4|~4.0"
}, },
"suggest": { "suggest": {
@ -949,12 +1043,13 @@
"symfony/http-foundation": "", "symfony/http-foundation": "",
"symfony/intl": "", "symfony/intl": "",
"symfony/property-access": "For accessing properties within comparison constraints", "symfony/property-access": "For accessing properties within comparison constraints",
"symfony/translation": "For translating validation errors.",
"symfony/yaml": "" "symfony/yaml": ""
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.4-dev" "dev-master": "4.2-dev"
} }
}, },
"autoload": { "autoload": {
@ -981,7 +1076,7 @@
], ],
"description": "Symfony Validator Component", "description": "Symfony Validator Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-05-05T16:11:06+00:00" "time": "2019-03-30T15:58:42+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -1091,62 +1186,6 @@
], ],
"time": "2019-01-28T20:25:53+00:00" "time": "2019-01-28T20:25:53+00:00"
}, },
{
"name": "doctrine/instantiator",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "a2c590166b2133a4633738648b6b064edae0814a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
"reference": "a2c590166b2133a4633738648b6b064edae0814a",
"shasum": ""
},
"require": {
"php": "^7.1"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.13",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
"time": "2019-03-17T17:37:11+00:00"
},
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v2.14.2", "version": "v2.14.2",
@ -3892,6 +3931,63 @@
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-03-30T15:58:42+00:00" "time": "2019-03-30T15:58:42+00:00"
}, },
{
"name": "symfony/dotenv",
"version": "v4.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/dotenv.git",
"reference": "b541d63b83532be55a020db8ed2e50598385a583"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dotenv/zipball/b541d63b83532be55a020db8ed2e50598385a583",
"reference": "b541d63b83532be55a020db8ed2e50598385a583",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"require-dev": {
"symfony/process": "~3.4|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Dotenv\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Registers environment variables from a .env file",
"homepage": "https://symfony.com",
"keywords": [
"dotenv",
"env",
"environment"
],
"time": "2019-04-01T07:32:59+00:00"
},
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v4.2.5", "version": "v4.2.5",
@ -4415,12 +4511,12 @@
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "dev", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": [],
"prefer-stable": true, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=7.1", "php": ">=7.0",
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*" "ext-json": "*"
}, },

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor>
<title>retailCRM PHP MG Bot API client</title>
<parser>
<target>docs</target>
<encoding>utf8</encoding>
<extensions>
<extension>php</extension>
</extensions>
</parser>
<transformer>
<target>mg-bot-api-client-php.pages</target>
</transformer>
<transformations>
<template name="clean" />
</transformations>
<files>
<directory>src</directory>
</files>
</phpdocumentor>

View File

@ -13,72 +13,246 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Bot class. Schema: * Bot class
*
* | Field name | Data type |
* |----------------|-----------|
* | name | string |
* | events | array |
* | client_id | string |
* | avatar_url | string |
* | roles | array |
* | deactivated_at | string |
* | is_active | bool |
* | is_self | bool |
* | is_system | bool |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method array getEvents() "Get `events` value"
* @method $this setEvents(array $value) "Set `events` value"
* @method string getClientId() "Get `client_id` value"
* @method $this setClientId(string $value) "Set `client_id` value"
* @method string getAvatarUrl() "Get `avatar_url` value"
* @method $this setAvatarUrl(string $value) "Set `avatar_url` value"
* @method array getRoles() "Get `roles` value"
* @method $this setRoles(array $value) "Set `roles` value"
* @method string getDeactivatedAt() "Get `deactivated_at` value"
* @method $this setDeactivatedAt(string $value) "Set `deactivated_at` value"
* @method bool getIsActive() "Get `is_active` value"
* @method $this setIsActive(bool $value) "Set `is_active` value"
* @method bool getIsSelf() "Get `is_self` value"
* @method $this setIsSelf(bool $value) "Set `is_self` value"
* @method bool getIsSystem() "Get `is_system` value"
* @method $this setIsSystem(bool $value) "Set `is_system` value"
*/ */
class Bot extends CommonFields class Bot
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'name' => 'string',
'events' => 'mixed', /**
'client_id' => 'string', * @var array $events
'avatar_url' => 'string', *
'roles' => 'mixed', * @Type("array")
'deactivated_at' => 'string', * @Accessor(getter="getEvents",setter="setEvents")
'is_active' => 'bool', * @SkipWhenEmpty()
'is_self' => 'bool', */
'is_system' => 'bool' private $events;
];
/**
* @var string $clientId
*
* @Type("string")
* @Accessor(getter="getClientId",setter="setClientId")
* @SkipWhenEmpty()
*/
private $clientId;
/**
* @var string $avatarUrl
*
* @Type("string")
* @Accessor(getter="getAvatarUrl",setter="setAvatarUrl")
* @SkipWhenEmpty()
*/
private $avatarUrl;
/**
* @var array $roles
*
* @Type("array")
* @Accessor(getter="getRoles",setter="setRoles")
* @SkipWhenEmpty()
*/
private $roles;
/**
* @var string $deactivatedAt
*
* @Type("string")
* @Accessor(getter="getDeactivatedAt",setter="setDeactivatedAt")
* @SkipWhenEmpty()
*/
private $deactivatedAt;
/**
* @var bool $isActive
*
* @Type("bool")
* @Accessor(getter="getIsActive",setter="setIsActive")
* @SkipWhenEmpty()
*/
private $isActive;
/**
* @var bool $isSelf
*
* @Type("bool")
* @Accessor(getter="getIsSelf",setter="setIsSelf")
* @SkipWhenEmpty()
*/
private $isSelf;
/**
* @var bool $isSystem
*
* @Type("bool")
* @Accessor(getter="getIsSystem",setter="setIsSystem")
* @SkipWhenEmpty()
*/
private $isSystem;
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return array
*/
public function getEvents(): array
{
return $this->events;
}
/**
* @param array $events
*/
public function setEvents(array $events)
{
$this->events = $events;
}
/**
* @return string
*/
public function getClientId(): string
{
return $this->clientId;
}
/**
* @param string $clientId
*/
public function setClientId(string $clientId)
{
$this->clientId = $clientId;
}
/**
* @return string
*/
public function getAvatarUrl(): string
{
return $this->avatarUrl;
}
/**
* @param string $avatarUrl
*/
public function setAvatarUrl(string $avatarUrl)
{
$this->avatarUrl = $avatarUrl;
}
/**
* @return array
*/
public function getRoles(): array
{
return $this->roles;
}
/**
* @param array $roles
*/
public function setRoles(array $roles)
{
$this->roles = $roles;
}
/**
* @return string
*/
public function getDeactivatedAt(): string
{
return $this->deactivatedAt;
}
/**
* @param string $deactivatedAt
*/
public function setDeactivatedAt(string $deactivatedAt)
{
$this->deactivatedAt = $deactivatedAt;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->isActive;
}
/**
* @param bool $isActive
*/
public function setIsActive(bool $isActive)
{
$this->isActive = $isActive;
}
/**
* @return bool
*/
public function isSelf(): bool
{
return $this->isSelf;
}
/**
* @param bool $isSelf
*/
public function setIsSelf(bool $isSelf)
{
$this->isSelf = $isSelf;
}
/**
* @return bool
*/
public function isSystem(): bool
{
return $this->isSystem;
}
/**
* @param bool $isSystem
*/
public function setIsSystem(bool $isSystem)
{
$this->isSystem = $isSystem;
}
} }

View File

@ -14,61 +14,164 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Channel; namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Channel class. Schema: * Channel class
*
* | Field name | Data type |
* |----------------|-----------------|
* | activated_at | string |
* | deactivated_at | string |
* | is_active | bool |
* | settings | ChannelSettings |
* | type | string |
* | name | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Channel * @package RetailCrm\Mg\Bot\Model\Entity\Channel
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getActivatedAt() "Get `activated_at` value"
* @method $this setActivatedAt(string $value) "Set `activated_at` value"
* @method string getDeactivatedAt() "Get `deactivated_at` value"
* @method $this setDeactivatedAt(string $value) "Set `deactivated_at` value"
* @method bool getIsActive() "Get `is_active` value"
* @method $this setIsActive(bool $value) "Set `is_active` value"
* @method ChannelSettings getSettings() "Get `settings` value"
* @method $this setSettings(ChannelSettings $value) "Set `settings` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
*/ */
class Channel extends CommonFields class Channel
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var \DateTime $activatedAt
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* $request = (new InfoRequest()) * @Accessor(getter="getActivatedAt",setter="setActivatedAt")
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $activatedAt;
'activated_at' => 'string',
'deactivated_at' => 'string', /**
'is_active' => 'bool', * @var \DateTime $deactivatedAt
'settings' => 'ChannelSettings', *
'type' => 'string', * @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
'name' => 'string' * @Accessor(getter="getDeactivatedAt",setter="setDeactivatedAt")
]; */
private $deactivatedAt;
/**
* @var bool $isActive
*
* @Type("bool")
* @Accessor(getter="getIsActive",setter="setIsActive")
*/
private $isActive;
/**
* @var ChannelSettings $settings
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettings")
* @Accessor(getter="getSettings",setter="setSettings")
*/
private $settings;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
*/
private $type;
/**
* @var string $actions
*
* @Type("string")
* @Accessor(getter="getName",setter="setName")
*/
private $name;
/**
* @return \DateTime
*/
public function getActivatedAt(): \DateTime
{
return $this->activatedAt;
}
/**
* @param \DateTime $activatedAt
*/
public function setActivatedAt(\DateTime $activatedAt)
{
$this->activatedAt = $activatedAt;
}
/**
* @return \DateTime
*/
public function getDeactivatedAt(): \DateTime
{
return $this->deactivatedAt;
}
/**
* @param \DateTime $deactivatedAt
*/
public function setDeactivatedAt(\DateTime $deactivatedAt)
{
$this->deactivatedAt = $deactivatedAt;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->isActive;
}
/**
* @param bool $isActive
*/
public function setIsActive(bool $isActive)
{
$this->isActive = $isActive;
}
/**
* @return ChannelSettings
*/
public function getSettings(): ChannelSettings
{
return $this->settings;
}
/**
* @param ChannelSettings $settings
*/
public function setSettings(ChannelSettings $settings)
{
$this->settings = $settings;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
} }

View File

@ -13,62 +13,192 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Channel; namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChannelSettings class. Schema: * ChannelSettings class
*
* | Field name | Data type |
* |------------|---------------------|
* | status | ChannelSettingsItem |
* | text | ChannelSettingsItem |
* | product | ChannelSettingsItem |
* | order | ChannelSettingsItem |
* | image | ChannelSettingsItem |
* | file | ChannelSettingsItem |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Channel * @package RetailCrm\Mg\Bot\Model\Entity\Channel
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method ChannelSettingsItem getStatus() "Get `status` value"
* @method $this setStatus(ChannelSettingsItem $value) "Set `status` value"
* @method ChannelSettingsItem getText() "Get `text` value"
* @method $this setText(ChannelSettingsItem $value) "Set `text` value"
* @method ChannelSettingsItem getProduct() "Get `product` value"
* @method $this setProduct(ChannelSettingsItem $value) "Set `product` value"
* @method ChannelSettingsItem getOrder() "Get `order` value"
* @method $this setOrder(ChannelSettingsItem $value) "Set `order` value"
* @method ChannelSettingsItem getImage() "Get `image` value"
* @method $this setImage(ChannelSettingsItem $value) "Set `image` value"
* @method ChannelSettingsItem getFile() "Get `file` value"
* @method $this setFile(ChannelSettingsItem $value) "Set `file` value"
*/ */
class ChannelSettings extends LazyJsonMapper class ChannelSettings
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var ChannelSettingsStatus $status
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsStatus")
* $request = (new InfoRequest()) * @Accessor(getter="getStatus",setter="setStatus")
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $status;
'status' => 'ChannelSettingsItem',
'text' => 'ChannelSettingsItem', /**
'product' => 'ChannelSettingsItem', * @var int $spamAllowed
'order' => 'ChannelSettingsItem', *
'image' => 'ChannelSettingsItem', * @Type("int")
'file' => 'ChannelSettingsItem' * @Accessor(getter="getStatus",setter="setStatus")
]; */
private $spamAllowed;
/**
* @var ChannelSettingsItem $text
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsItem")
* @Accessor(getter="getText",setter="setText")
* @SkipWhenEmpty()
*/
private $text;
/**
* @var ChannelSettingsItem $product
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsItem")
* @Accessor(getter="getProduct",setter="setProduct")
* @SkipWhenEmpty()
*/
private $product;
/**
* @var ChannelSettingsItem $order
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsItem")
* @Accessor(getter="getOrder",setter="setOrder")
* @SkipWhenEmpty()
*/
private $order;
/**
* @var ChannelSettingsItem $image
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsItem")
* @Accessor(getter="getImage",setter="setImage")
* @SkipWhenEmpty()
*/
private $image;
/**
* @var ChannelSettingsItem $file
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsItem")
* @Accessor(getter="getFile",setter="setFile")
* @SkipWhenEmpty()
*/
private $file;
/**
* @return ChannelSettingsStatus
*/
public function getStatus(): ChannelSettingsStatus
{
return $this->status;
}
/**
* @param ChannelSettingsStatus $status
*/
public function setStatus(ChannelSettingsStatus $status)
{
$this->status = $status;
}
/**
* @return int
*/
public function getSpamAllowed(): int
{
return $this->spamAllowed;
}
/**
* @param int $spamAllowed
*/
public function setSpamAllowed(int $spamAllowed)
{
$this->spamAllowed = $spamAllowed;
}
/**
* @return ChannelSettingsItem
*/
public function getText(): ChannelSettingsItem
{
return $this->text;
}
/**
* @param ChannelSettingsItem $text
*/
public function setText(ChannelSettingsItem $text)
{
$this->text = $text;
}
/**
* @return ChannelSettingsItem
*/
public function getProduct(): ChannelSettingsItem
{
return $this->product;
}
/**
* @param ChannelSettingsItem $product
*/
public function setProduct(ChannelSettingsItem $product)
{
$this->product = $product;
}
/**
* @return ChannelSettingsItem
*/
public function getOrder(): ChannelSettingsItem
{
return $this->order;
}
/**
* @param ChannelSettingsItem $order
*/
public function setOrder(ChannelSettingsItem $order)
{
$this->order = $order;
}
/**
* @return ChannelSettingsItem
*/
public function getImage(): ChannelSettingsItem
{
return $this->image;
}
/**
* @param ChannelSettingsItem $image
*/
public function setImage(ChannelSettingsItem $image)
{
$this->image = $image;
}
/**
* @return ChannelSettingsItem
*/
public function getFile(): ChannelSettingsItem
{
return $this->file;
}
/**
* @param ChannelSettingsItem $file
*/
public function setFile(ChannelSettingsItem $file)
{
$this->file = $file;
}
} }

View File

@ -13,62 +13,169 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Channel; namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChannelSettingsItem class. Schema: * ChannelSettingsItem class
*
* | Field name | Data type |
* |-----------------|-----------|
* | creating | string |
* | editing | string |
* | quoting | string |
* | deleting | string |
* | delivered | string |
* | max_items_count | int |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Channel * @package RetailCrm\Mg\Bot\Model\Entity\Channel
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getCreating() "Get `creating` value"
* @method $this setCreating(string $value) "Set `creating` value"
* @method string getEditing() "Get `editing` value"
* @method $this setEditing(string $value) "Set `editing` value"
* @method string getQuoting() "Get `quoting` value"
* @method $this setQuoting(string $value) "Set `quoting` value"
* @method string getDeleting() "Get `deleting` value"
* @method $this setDeleting(string $value) "Set `deleting` value"
* @method string getDelivered() "Get `delivered` value"
* @method $this setDelivered(string $value) "Set `delivered` value"
* @method int getMaxItemsCount() "Get `max_items_count` value"
* @method $this setMaxItemsCount(int $value) "Set `max_items_count` value"
*/ */
class ChannelSettingsItem extends LazyJsonMapper class ChannelSettingsItem
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $creating
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getCreating",setter="setCreating")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $creating;
'creating' => 'string',
'editing' => 'string', /**
'quoting' => 'string', * @var string $editing
'deleting' => 'string', *
'delivered' => 'string', * @Type("string")
'max_items_count' => 'int' * @Accessor(getter="getEditing",setter="setEditing")
]; * @SkipWhenEmpty()
*/
private $editing;
/**
* @var string $quoting
*
* @Type("string")
* @Accessor(getter="getQuoting",setter="setQuoting")
* @SkipWhenEmpty()
*/
private $quoting;
/**
* @var string $deleting
*
* @Type("string")
* @Accessor(getter="getDeleting",setter="setDeleting")
* @SkipWhenEmpty()
*/
private $deleting;
/**
* @var string $delivered
*
* @Type("string")
* @Accessor(getter="getDelivered",setter="setDelivered")
* @SkipWhenEmpty()
*/
private $delivered;
/**
* @var int $maxItemsCount
*
* @Type("int")
* @Accessor(getter="getMaxItemsCount",setter="setMaxItemsCount")
* @SkipWhenEmpty()
*/
private $maxItemsCount;
/**
* @return string
*/
public function getCreating(): string
{
return $this->creating;
}
/**
* @param string $creating
*/
public function setCreating(string $creating)
{
$this->creating = $creating;
}
/**
* @return string
*/
public function getEditing(): string
{
return $this->editing;
}
/**
* @param string $editing
*/
public function setEditing(string $editing)
{
$this->editing = $editing;
}
/**
* @return string
*/
public function getQuoting(): string
{
return $this->quoting;
}
/**
* @param string $quoting
*/
public function setQuoting(string $quoting)
{
$this->quoting = $quoting;
}
/**
* @return string
*/
public function getDeleting(): string
{
return $this->deleting;
}
/**
* @param string $deleting
*/
public function setDeleting(string $deleting)
{
$this->deleting = $deleting;
}
/**
* @return string
*/
public function getDelivered(): string
{
return $this->delivered;
}
/**
* @param string $delivered
*/
public function setDelivered(string $delivered)
{
$this->delivered = $delivered;
}
/**
* @return int
*/
public function getMaxItemsCount(): int
{
return $this->maxItemsCount;
}
/**
* @param int $maxItemsCount
*/
public function setMaxItemsCount(int $maxItemsCount)
{
$this->maxItemsCount = $maxItemsCount;
}
} }

View File

@ -0,0 +1,81 @@
<?php
/**
* PHP version 7.0
*
* ChannelSettingsStatus entity
*
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
* @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers
*/
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/**
* PHP version 7.0
*
* ChannelSettingsStatus class
*
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
* @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers
*/
class ChannelSettingsStatus
{
/**
* @var string $delivered
*
* @Type("string")
* @Accessor(getter="getDelivered",setter="setDelivered")
* @SkipWhenEmpty()
*/
private $delivered;
/**
* @var string $read
*
* @Type("string")
* @Accessor(getter="getRead",setter="setRead")
* @SkipWhenEmpty()
*/
private $read;
/**
* @return string
*/
public function getDelivered(): string
{
return $this->delivered;
}
/**
* @param string $delivered
*/
public function setDelivered(string $delivered)
{
$this->delivered = $delivered;
}
/**
* @return string
*/
public function getRead(): string
{
return $this->read;
}
/**
* @param string $read
*/
public function setRead(string $read)
{
$this->read = $read;
}
}

View File

@ -13,70 +13,216 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Chat; namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
use RetailCrm\Mg\Bot\Model\Entity\Channel\Channel;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\Customer;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Chat class. Schema: * Chat class
*
* | Field name | Data type |
* |---------------|-----------------|
* | avatar | string |
* | name | string |
* | channel | Channel |
* | members | array |
* | customer | Customer |
* | author_id | int |
* | last_message | ChatLastMessage |
* | last_activity | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Chat * @package RetailCrm\Mg\Bot\Model\Entity\Chat
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getAvatar() "Get `avatar` value"
* @method $this setAvatar(string $value) "Set `avatar` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method Channel getChannel() "Get `channel` value"
* @method $this setChannel(Channel $value) "Set `channel` value"
* @method array getMembers() "Get `members` value"
* @method $this setMembers(array $value) "Set `members` value"
* @method Customer getCustomer() "Get `customer` value"
* @method $this setCustomer(Customer $value) "Set `customer` value"
* @method int getAuthorId() "Get `author_id` value"
* @method $this setAuthorId(int $value) "Set `author_id` value"
* @method ChatLastMessage getLastMessage() "Get `last_message` value"
* @method $this setLastMessage(ChatLastMessage $value) "Set `last_message` value"
* @method string getLastActivity() "Get `last_activity` value"
* @method $this setLastActivity(string $value) "Set `last_activity` value"
*/ */
class Chat extends CommonFields class Chat
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $avatar
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getAvatar",setter="setAvatar")
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $avatar;
'avatar' => 'string',
'name' => 'string', /**
'channel' => '\RetailCrm\Mg\Bot\Model\Entity\Channel\Channel', * @var string $name
'members' => 'ChatMember[]', *
'customer' => '\RetailCrm\Mg\Bot\Model\Entity\Customer', * @Type("string")
'author_id' => 'int', * @Accessor(getter="getName",setter="setName")
'last_message' => 'ChatLastMessage', */
'last_activity' => 'string' private $name;
];
/**
* @var Channel $channel
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\Channel")
* @Accessor(getter="getChannel",setter="setChannel")
*/
private $channel;
/**
* @var array $members
*
* @Type("array")
* @Accessor(getter="getMembers",setter="setMembers")
*/
private $members;
/**
* @var Customer $customer
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Customer")
* @Accessor(getter="getCustomer",setter="setCustomer")
*/
private $customer;
/**
* @var int $authorId
*
* @Type("int")
* @Accessor(getter="getAuthorId",setter="setAuthorId")
*/
private $authorId;
/**
* @var ChatLastMessage $lastMessage
*
* @Type("ChatLastMessage")
* @Accessor(getter="getLastMessage",setter="setLastMessage")
*/
private $lastMessage;
/**
* @var \DateTime $lastActivity
*
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
* @Accessor(getter="getLastActivity",setter="setLastActivity")
*/
private $lastActivity;
/**
* @return string
*/
public function getAvatar(): string
{
return $this->avatar;
}
/**
* @param string $avatar
*/
public function setAvatar(string $avatar)
{
$this->avatar = $avatar;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return Channel
*/
public function getChannel(): Channel
{
return $this->channel;
}
/**
* @param Channel $channel
*/
public function setChannel(Channel $channel)
{
$this->channel = $channel;
}
/**
* @return array
*/
public function getMembers(): array
{
return $this->members;
}
/**
* @param array $members
*/
public function setMembers(array $members)
{
$this->members = $members;
}
/**
* @return Customer
*/
public function getCustomer(): Customer
{
return $this->customer;
}
/**
* @param Customer $customer
*/
public function setCustomer(Customer $customer)
{
$this->customer = $customer;
}
/**
* @return int
*/
public function getAuthorId(): int
{
return $this->authorId;
}
/**
* @param int $authorId
*/
public function setAuthorId(int $authorId)
{
$this->authorId = $authorId;
}
/**
* @return ChatLastMessage
*/
public function getLastMessage(): ChatLastMessage
{
return $this->lastMessage;
}
/**
* @param ChatLastMessage $lastMessage
*/
public function setLastMessage(ChatLastMessage $lastMessage)
{
$this->lastMessage = $lastMessage;
}
/**
* @return \DateTime
*/
public function getLastActivity(): \DateTime
{
return $this->lastActivity;
}
/**
* @param \DateTime $lastActivity
*/
public function setLastActivity(\DateTime $lastActivity)
{
$this->lastActivity = $lastActivity;
}
} }

View File

@ -13,51 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Chat; namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
use JMS\Serializer\Annotation\Accessor;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChatLastMessage class. Schema: * ChatLastMessage class
*
* | Field name | Data type |
* |------------|-----------|
* | id | int |
* | time | string |
* | type | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Chat * @package RetailCrm\Mg\Bot\Model\Entity\Chat
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getTime() "Get `time` value"
* @method $this setTime(string $value) "Set `time` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
*/ */
class ChatLastMessage extends LazyJsonMapper class ChatLastMessage
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $creating
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'int',
'time' => 'string', /**
'type' => 'string' * @var \DateTime $time
]; *
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getTime",setter="setTime")
* @SkipWhenEmpty()
*/
private $time;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getTime(): string
{
return $this->time;
}
/**
* @param string $time
*/
public function setTime(string $time)
{
$this->time = $time;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
} }

View File

@ -13,54 +13,122 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Chat; namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChatMember class. Schema: * ChatMember class
*
* | Field name | Data type |
* |------------|-----------|
* | chat_id | int |
* | user_id | int |
* | is_author | bool |
* | state | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Chat * @package RetailCrm\Mg\Bot\Model\Entity\Chat
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getUserId() "Get `user_id` value"
* @method $this setUserId(int $value) "Set `user_id` value"
* @method bool getIsAuthor() "Get `is_author` value"
* @method $this setIsAuthor(bool $value) "Set `is_author` value"
* @method string getState() "Get `state` value"
* @method $this setState(string $value) "Set `state` value"
*/ */
class ChatMember extends CommonFields class ChatMember
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $chatId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getChatId",setter="setChatId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $chatId;
'chat_id' => 'int',
'user_id' => 'int', /**
'is_author' => 'bool', * @var int $userId
'state' => 'string' *
]; * @Type("int")
* @Accessor(getter="getUserId",setter="setUserId")
* @SkipWhenEmpty()
*/
private $userId;
/**
* @var bool $isAuthor
*
* @Type("bool")
* @Accessor(getter="getIsAuthor",setter="setIsAuthor")
* @SkipWhenEmpty()
*/
private $isAuthor;
/**
* @var string $creating
*
* @Type("string")
* @Accessor(getter="getState",setter="setState")
* @SkipWhenEmpty()
*/
private $state;
/**
* @return int
*/
public function getChatId(): int
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return int
*/
public function getUserId(): int
{
return $this->userId;
}
/**
* @param int $userId
*/
public function setUserId(int $userId)
{
$this->userId = $userId;
}
/**
* @return bool
*/
public function isAuthor(): bool
{
return $this->isAuthor;
}
/**
* @param bool $isAuthor
*/
public function setIsAuthor(bool $isAuthor)
{
$this->isAuthor = $isAuthor;
}
/**
* @return string
*/
public function getState(): string
{
return $this->state;
}
/**
* @param string $state
*/
public function setState(string $state)
{
$this->state = $state;
}
} }

View File

@ -13,44 +13,71 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Command class. Schema: * Command class
*
* | Field name | Data type |
* |-------------|-----------|
* | name | string |
* | description | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method string getDescription() "Get `description` value"
* @method $this setDescription(string $value) "Set `description` value"
*/ */
class Command extends CommonFields class Command
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'name' => 'string',
'description' => 'string' /**
]; * @var string $description
*
* @Type("string")
* @Accessor(getter="getDescrtiption",setter="setDescription")
* @SkipWhenEmpty()
*/
private $description;
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getDescription(): string
{
return $this->description;
}
/**
* @param string $description
*/
public function setDescription(string $description)
{
$this->description = $description;
}
} }

View File

@ -13,50 +13,95 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints\Date;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* CommonFields trait. Schema: * CommonFields trait
*
* | Field name | Data type |
* |------------|-----------|
* | id | int |
* | created_at | string |
* | updated_at | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getCreatedAt() "Get `created_at` value"
* @method $this setCreatedAt(string $value) "Set `created_at` value"
* @method string getUpdatedAt() "Get `updated_at` value"
* @method $this setUpdatedAt(string $value) "Set `updated_at` value"
*/ */
class CommonFields extends LazyJsonMapper trait CommonFields
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $id
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'int',
'created_at' => 'string', /**
'updated_at' => 'string' * @var \DateTime $createdAt
]; *
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
* @SkipWhenEmpty()
*/
private $createdAt;
/**
* @var \DateTime $createdAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
* @SkipWhenEmpty()
*/
private $updatedAt;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id)
{
$this->id = $id;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTime
*/
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
*/
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
}
} }

View File

@ -14,85 +14,322 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Customer class. Schema: * Customer class
*
* | Field name | Data type |
* |-------------|-----------|
* | external_id | string |
* | channel_id | int |
* | username | string |
* | first_name | string |
* | last_name | string |
* | avatar_url | string |
* | profile_url | string |
* | revoked_at | string |
* | country | string |
* | language | string |
* | phone | string |
* | email | string | * | email | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getExternalId() "Get `external_id` value"
* @method $this setExternalId(string $value) "Set `external_id` value"
* @method int getChannelId() "Get `channel_id` value"
* @method $this setChannelId(int $value) "Set `channel_id` value"
* @method string getUsername() "Get `username` value"
* @method $this setUsername(string $value) "Set `username` value"
* @method string getFirstName() "Get `first_name` value"
* @method $this setFirstName(string $value) "Set `first_name` value"
* @method string getLastName() "Get `last_name` value"
* @method $this setLastName(string $value) "Set `last_name` value"
* @method string getAvatarUrl() "Get `avatar_url` value"
* @method $this setAvatarUrl(string $value) "Set `avatar_url` value"
* @method string getProfileUrl() "Get `profile_url` value"
* @method $this setProfileUrl(string $value) "Set `profile_url` value"
* @method string getRevokedAt() "Get `revoked_at` value"
* @method $this setRevokedAt(string $value) "Set `revoked_at` value"
* @method string getCountry() "Get `country` value"
* @method $this setCountry(string $value) "Set `country` value"
* @method string getLanguage() "Get `language` value"
* @method $this setLanguage(string $value) "Set `language` value"
* @method string getPhone() "Get `phone` value"
* @method $this setPhone(string $value) "Set `phone` value"
* @method string getEmail() "Get `email` value"
* @method $this setEmail(string $value) "Set `email` value"
*/ */
class Customer extends CommonFields class Customer
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $externalId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getExternalId",setter="setExternalId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $externalId;
'external_id' => 'string',
'channel_id' => 'int', /**
'username' => 'string', * @var int $channelId
'first_name' => 'string', *
'last_name' => 'string', * @Type("int")
'avatar_url' => 'string', * @Accessor(getter="getChannelId",setter="setChannelId")
'profile_url' => 'string', * @SkipWhenEmpty()
'revoked_at' => 'string', */
'country' => 'string', private $channelId;
'language' => 'string',
'phone' => 'string', /**
'email' => 'string' * @var string $username
]; *
* @Type("string")
* @Accessor(getter="getUsername",setter="setUsername")
* @SkipWhenEmpty()
*/
private $username;
/**
* @var string $firstName
*
* @Type("string")
* @Accessor(getter="getFirstName",setter="setFirstName")
* @SkipWhenEmpty()
*/
private $firstName;
/**
* @var string $lastName
*
* @Type("string")
* @Accessor(getter="getLastName",setter="setLastName")
* @SkipWhenEmpty()
*/
private $lastName;
/**
* @var string $avatarUrl
*
* @Type("string")
* @Accessor(getter="getAvatarUrl",setter="setAvatarUrl")
* @SkipWhenEmpty()
*/
private $avatarUrl;
/**
* @var string $profileUrl
*
* @Type("string")
* @Accessor(getter="getProfileUrl",setter="setProfileUrl")
* @SkipWhenEmpty()
*/
private $profileUrl;
/**
* @var string $revokedAt
*
* @Type("string")
* @Accessor(getter="getRevokedAt",setter="setRevokedAt")
* @SkipWhenEmpty()
*/
private $revokedAt;
/**
* @var string $country
*
* @Type("string")
* @Accessor(getter="getCountry",setter="setCountry")
* @SkipWhenEmpty()
*/
private $country;
/**
* @var string $language
*
* @Type("string")
* @Accessor(getter="getLanguage",setter="setLanguage")
* @SkipWhenEmpty()
*/
private $language;
/**
* @var string $phone
*
* @Type("string")
* @Accessor(getter="getPhone",setter="setPhone")
* @SkipWhenEmpty()
*/
private $phone;
/**
* @var string $email
*
* @Type("string")
* @Accessor(getter="getEmail",setter="setEmail")
* @SkipWhenEmpty()
*/
private $email;
/**
* @return string
*/
public function getExternalId(): string
{
return $this->externalId;
}
/**
* @param string $externalId
*/
public function setExternalId(string $externalId)
{
$this->externalId = $externalId;
}
/**
* @return int
*/
public function getChannelId(): int
{
return $this->channelId;
}
/**
* @param int $channelId
*/
public function setChannelId(int $channelId)
{
$this->channelId = $channelId;
}
/**
* @return string
*/
public function getUsername(): string
{
return $this->username;
}
/**
* @param string $username
*/
public function setUsername(string $username)
{
$this->username = $username;
}
/**
* @return string
*/
public function getFirstName(): string
{
return $this->firstName;
}
/**
* @param string $firstName
*/
public function setFirstName(string $firstName)
{
$this->firstName = $firstName;
}
/**
* @return string
*/
public function getLastName(): string
{
return $this->lastName;
}
/**
* @param string $lastName
*/
public function setLastName(string $lastName)
{
$this->lastName = $lastName;
}
/**
* @return string
*/
public function getAvatarUrl(): string
{
return $this->avatarUrl;
}
/**
* @param string $avatarUrl
*/
public function setAvatarUrl(string $avatarUrl)
{
$this->avatarUrl = $avatarUrl;
}
/**
* @return string
*/
public function getProfileUrl(): string
{
return $this->profileUrl;
}
/**
* @param string $profileUrl
*/
public function setProfileUrl(string $profileUrl)
{
$this->profileUrl = $profileUrl;
}
/**
* @return string
*/
public function getRevokedAt(): string
{
return $this->revokedAt;
}
/**
* @param string $revokedAt
*/
public function setRevokedAt(string $revokedAt)
{
$this->revokedAt = $revokedAt;
}
/**
* @return string
*/
public function getCountry(): string
{
return $this->country;
}
/**
* @param string $country
*/
public function setCountry(string $country)
{
$this->country = $country;
}
/**
* @return string
*/
public function getLanguage(): string
{
return $this->language;
}
/**
* @param string $language
*/
public function setLanguage(string $language)
{
$this->language = $language;
}
/**
* @return string
*/
public function getPhone(): string
{
return $this->phone;
}
/**
* @param string $phone
*/
public function setPhone(string $phone)
{
$this->phone = $phone;
}
/**
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @param string $email
*/
public function setEmail(string $email)
{
$this->email = $email;
}
} }

View File

@ -14,69 +14,221 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Dialog class. Schema: * Dialog class
*
* | Field name | Data type |
* |-------------------|-------------|
* | bot_id | int |
* | chat_id | int |
* | begin_message_id | int |
* | ending_message_id | int |
* | closed_at | string |
* | is_assigned | bool |
* | responsible | Responsible |
* | is_active | bool |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getBotId() "Get `bot_id` value"
* @method $this setBotId(int $value) "Set `bot_id` value"
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getBeginMessageId() "Get `begin_message_id` value"
* @method $this setBeginMessageId(int $value) "Set `begin_message_id` value"
* @method int getEndingMessageId() "Get `ending_message_id` value"
* @method $this setEndingMessageId(int $value) "Set `ending_message_id` value"
* @method string getClosedAt() "Get `closed_at` value"
* @method $this setClosedAt(string $value) "Set `closed_at` value"
* @method bool getIsAssigned() "Get `is_assigned` value"
* @method $this setIsAssigned(bool $value) "Set `is_assigned` value"
* @method Responsible getResponsible() "Get `responsible` value"
* @method $this setResponsible(Responsible $value) "Set `responsible` value"
* @method bool getIsActive() "Get `is_active` value"
* @method $this setIsActive(bool $value) "Set `is_active` value"
*/ */
class Dialog extends CommonFields class Dialog
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $botId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getBotId",setter="setBotId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $botId;
'bot_id' => 'int',
'chat_id' => 'int', /**
'begin_message_id' => 'int', * @var int $chatId
'ending_message_id' => 'int', *
'closed_at' => 'string', * @Type("int")
'is_assigned' => 'bool', * @Accessor(getter="getChatId",setter="setChatId")
'responsible' => 'Responsible', * @SkipWhenEmpty()
'is_active' => 'bool' */
]; private $chatId;
/**
* @var int $beginMessageId
*
* @Type("int")
* @Accessor(getter="getBeginMessageId",setter="setBeginMessageId")
* @SkipWhenEmpty()
*/
private $beginMessageId;
/**
* @var int $endingMessageId
*
* @Type("int")
* @Accessor(getter="getEndingMessageId",setter="setEndingMessageId")
* @SkipWhenEmpty()
*/
private $endingMessageId;
/**
* @var \DateTime $closedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getClosedAt",setter="setClosedAt")
* @SkipWhenEmpty()
*/
private $closedAt;
/**
* @var bool $isAssigned
*
* @Type("bool")
* @Accessor(getter="getIsAssigned",setter="setIsAssigned")
* @SkipWhenEmpty()
*/
private $isAssigned;
/**
* @var Responsible $responsible
*
* @Type("RetailCrm\Mg\Bot\Model\Entity\Responsible")
* @Accessor(getter="getResponsible",setter="setResponsible")
* @SkipWhenEmpty()
*/
private $responsible;
/**
* @var bool $isActive
*
* @Type("bool")
* @Accessor(getter="getIsActive",setter="setIsActive")
* @SkipWhenEmpty()
*/
private $isActive;
/**
* @return int
*/
public function getBotId(): int
{
return $this->botId;
}
/**
* @param int $botId
*/
public function setBotId(int $botId)
{
$this->botId = $botId;
}
/**
* @return int
*/
public function getChatId(): int
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return int
*/
public function getBeginMessageId(): int
{
return $this->beginMessageId;
}
/**
* @param int $beginMessageId
*/
public function setBeginMessageId(int $beginMessageId)
{
$this->beginMessageId = $beginMessageId;
}
/**
* @return int
*/
public function getEndingMessageId(): int
{
return $this->endingMessageId;
}
/**
* @param int $endingMessageId
*/
public function setEndingMessageId(int $endingMessageId)
{
$this->endingMessageId = $endingMessageId;
}
/**
* @return \DateTime
*/
public function getClosedAt(): \DateTime
{
return $this->closedAt;
}
/**
* @param \DateTime $closedAt
*/
public function setClosedAt(\DateTime $closedAt)
{
$this->closedAt = $closedAt;
}
/**
* @return bool
*/
public function isAssigned(): bool
{
return $this->isAssigned;
}
/**
* @param bool $isAssigned
*/
public function setIsAssigned(bool $isAssigned)
{
$this->isAssigned = $isAssigned;
}
/**
* @return Responsible
*/
public function getResponsible(): Responsible
{
return $this->responsible;
}
/**
* @param Responsible $responsible
*/
public function setResponsible(Responsible $responsible)
{
$this->responsible = $responsible;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->isActive;
}
/**
* @param bool $isActive
*/
public function setIsActive(bool $isActive)
{
$this->isActive = $isActive;
}
} }

View File

@ -13,46 +13,69 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* FileMeta class. Schema: * FileMeta class
*
* | Field name | Data type |
* |------------|-----------|
* | height | int |
* | width | int |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getHeight() "Get `height` value"
* @method $this setHeight(int $value) "Set `height` value"
* @method int getWidth() "Get `width` value"
* @method $this setWidth(int $value) "Set `width` value"
*/ */
class FileMeta extends LazyJsonMapper class FileMeta
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $height
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getHeight",setter="setHeight")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $height;
'height' => 'int',
'width' => 'int' /**
]; * @var int $width
*
* @Type("int")
* @Accessor(getter="getWidth",setter="setWidth")
* @SkipWhenEmpty()
*/
private $width;
/**
* @return int
*/
public function getHeight(): int
{
return $this->height;
}
/**
* @param int $height
*/
public function setHeight(int $height)
{
$this->height = $height;
}
/**
* @return int
*/
public function getWidth(): int
{
return $this->width;
}
/**
* @param int $width
*/
public function setWidth(int $width)
{
$this->width = $width;
}
} }

View File

@ -13,50 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Item class. Schema: * Item class
*
* | Field name | Data type |
* |------------|-----------|
* | id | int |
* | size | int |
* | caption | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method int getSize() "Get `size` value"
* @method $this setSize(int $value) "Set `size` value"
* @method string getCaption() "Get `caption` value"
* @method $this setCaption(string $value) "Set `caption` value"
*/ */
class Item extends CommonFields class Item
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $id
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'int',
'size' => 'int', /**
'caption' => 'string' * @var int $size
]; *
* @Type("int")
* @Accessor(getter="getSize",setter="setSize")
* @SkipWhenEmpty()
*/
private $size;
/**
* @var string $caption
*
* @Type("string")
* @Accessor(getter="getCaption",setter="setCaption")
* @SkipWhenEmpty()
*/
private $caption;
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id)
{
$this->id = $id;
}
/**
* @return int
*/
public function getSize(): int
{
return $this->size;
}
/**
* @param int $size
*/
public function setSize(int $size)
{
$this->size = $size;
}
/**
* @return string
*/
public function getCaption()
{
return $this->caption;
}
/**
* @param string $caption
*/
public function setCaption(string $caption)
{
$this->caption = $caption;
}
} }

View File

@ -14,105 +14,448 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use RetailCrm\Mg\Bot\Model\Entity\Dialog;
use RetailCrm\Mg\Bot\Model\Entity\User;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Message class. Schema: * Message class
*
* | Field name | Data type |
* |-----------------|----------------|
* | actions | array |
* | items | array |
* | from | User |
* | time | string |
* | type | string |
* | scope | string |
* | chat_id | int |
* | content | string |
* | is_read | bool |
* | is_edit | bool |
* | status | string |
* | action | string |
* | dialog | Dialog |
* | channel_id | int |
* | channel_sent_at | string |
* | order | MessageOrder |
* | product | MessageProduct |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method array getActions() "Get `actions` value"
* @method $this setActions(array $value) "Set `actions` value"
* @method array getItems() "Get `items` value"
* @method $this setItems(array $value) "Set `items` value"
* @method User getFrom() "Get `from` value"
* @method $this setFrom(User $value) "Set `from` value"
* @method string getTime() "Get `time` value"
* @method $this setTime(string $value) "Set `time` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
* @method string getScope() "Get `scope` value"
* @method $this setScope(string $value) "Set `scope` value"
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method string getContent() "Get `content` value"
* @method $this setContent(string $value) "Set `content` value"
* @method bool getIsRead() "Get `is_read` value"
* @method $this setIsRead(bool $value) "Set `is_read` value"
* @method bool getIsEdit() "Get `is_edit` value"
* @method $this setIsEdit(bool $value) "Set `is_edit` value"
* @method string getStatus() "Get `status` value"
* @method $this setStatus(string $value) "Set `status` value"
* @method string getAction() "Get `action` value"
* @method $this setAction(string $value) "Set `action` value"
* @method Dialog getDialog() "Get `dialog` value"
* @method $this setDialog(Dialog $value) "Set `dialog` value"
* @method int getChannelId() "Get `channel_id` value"
* @method $this setChannelId(int $value) "Set `channel_id` value"
* @method string getChannelSentAt() "Get `channel_sent_at` value"
* @method $this setChannelSentAt(string $value) "Set `channel_sent_at` value"
* @method MessageOrder getOrder() "Get `order` value"
* @method $this setOrder(MessageOrder $value) "Set `order` value"
* @method MessageProduct getProduct() "Get `product` value"
* @method $this setProduct(MessageProduct $value) "Set `product` value"
*/ */
class Message extends CommonFields class Message
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $actions
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getActions",setter="setActions")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $actions;
'actions' => '[]',
'items' => 'Item[]', /**
'from' => '\RetailCrm\Mg\Bot\Model\Entity\User', * @var array $items
'time' => 'string', *
'type' => 'string', * @Type("array")
'scope' => 'string', * @Accessor(getter="getItems",setter="setItems")
'chat_id' => 'int', * @SkipWhenEmpty()
'content' => 'string', */
'is_read' => 'bool', private $items;
'is_edit' => 'bool',
'status' => 'string', /**
'action' => 'string', * @var User $from
'dialog' => '\RetailCrm\Mg\Bot\Model\Entity\Dialog', *
'channel_id' => 'int', * @Type("RetailCrm\Mg\Bot\Model\Entity\User")
'channel_sent_at' => 'string', * @Accessor(getter="getFrom",setter="setFrom")
'order' => 'MessageOrder', * @SkipWhenEmpty()
'product' => 'MessageProduct', */
]; private $from;
/**
* @var \DateTime $time
*
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
* @Accessor(getter="getTime",setter="setTime")
* @SkipWhenEmpty()
*/
private $time;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @var string $scope
*
* @Type("string")
* @Accessor(getter="getScope",setter="setScope")
* @SkipWhenEmpty()
*/
private $scope;
/**
* @var int $chatId
*
* @Type("int")
* @Accessor(getter="getChatId",setter="setChatId")
* @SkipWhenEmpty()
*/
private $chatId;
/**
* @var string $content
*
* @Type("string")
* @Accessor(getter="getContent",setter="setContent")
* @SkipWhenEmpty()
*/
private $content;
/**
* @var bool $isRead
*
* @Type("bool")
* @Accessor(getter="getIsRead",setter="setIsRead")
* @SkipWhenEmpty()
*/
private $isRead;
/**
* @var bool $isEdit
*
* @Type("bool")
* @Accessor(getter="getIsEdit",setter="setIsEdit")
* @SkipWhenEmpty()
*/
private $isEdit;
/**
* @var string $status
*
* @Type("string")
* @Accessor(getter="getStatus",setter="setStatus")
* @SkipWhenEmpty()
*/
private $status;
/**
* @var string $action
*
* @Type("string")
* @Accessor(getter="getAction",setter="setAction")
* @SkipWhenEmpty()
*/
private $action;
/**
* @var Dialog $dialog
*
* @Type("Dialog")
* @Accessor(getter="getDialog",setter="setDialog")
* @SkipWhenEmpty()
*/
private $dialog;
/**
* @var int $channelId
*
* @Type("int")
* @Accessor(getter="getChannelId",setter="setChannelId")
* @SkipWhenEmpty()
*/
private $channelId;
/**
* @var \DateTime $channelSentAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getChannelSentAt",setter="setChannelSentAt")
* @SkipWhenEmpty()
*/
private $channelSentAt;
/**
* @var MessageOrder $order
*
* @Type("MessageOrder")
* @Accessor(getter="getOrder",setter="setOrder")
* @SkipWhenEmpty()
*/
private $order;
/**
* @var MessageProduct $product
*
* @Type("MessageProduct")
* @Accessor(getter="getProduct",setter="setProduct")
* @SkipWhenEmpty()
*/
private $product;
/**
* @return string
*/
public function getActions(): string
{
return $this->actions;
}
/**
* @param string $actions
*/
public function setActions(string $actions)
{
$this->actions = $actions;
}
/**
* @return array
*/
public function getItems(): array
{
return $this->items;
}
/**
* @param array $items
*/
public function setItems(array $items)
{
$this->items = $items;
}
/**
* @return User
*/
public function getFrom(): User
{
return $this->from;
}
/**
* @param User $from
*/
public function setFrom(User $from)
{
$this->from = $from;
}
/**
* @return \DateTime
*/
public function getTime(): \DateTime
{
return $this->time;
}
/**
* @param \DateTime $time
*/
public function setTime(\DateTime $time)
{
$this->time = $time;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getScope(): string
{
return $this->scope;
}
/**
* @param string $scope
*/
public function setScope(string $scope)
{
$this->scope = $scope;
}
/**
* @return int
*/
public function getChatId(): int
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return string
*/
public function getContent(): string
{
return $this->content;
}
/**
* @param string $content
*/
public function setContent(string $content)
{
$this->content = $content;
}
/**
* @return bool
*/
public function isRead(): bool
{
return $this->isRead;
}
/**
* @param bool $isRead
*/
public function setIsRead(bool $isRead)
{
$this->isRead = $isRead;
}
/**
* @return bool
*/
public function isEdit(): bool
{
return $this->isEdit;
}
/**
* @param bool $isEdit
*/
public function setIsEdit(bool $isEdit)
{
$this->isEdit = $isEdit;
}
/**
* @return string
*/
public function getStatus(): string
{
return $this->status;
}
/**
* @param string $status
*/
public function setStatus(string $status)
{
$this->status = $status;
}
/**
* @return string
*/
public function getAction(): string
{
return $this->action;
}
/**
* @param string $action
*/
public function setAction(string $action)
{
$this->action = $action;
}
/**
* @return Dialog
*/
public function getDialog(): Dialog
{
return $this->dialog;
}
/**
* @param Dialog $dialog
*/
public function setDialog(Dialog $dialog)
{
$this->dialog = $dialog;
}
/**
* @return int
*/
public function getChannelId(): int
{
return $this->channelId;
}
/**
* @param int $channelId
*/
public function setChannelId(int $channelId)
{
$this->channelId = $channelId;
}
/**
* @return \DateTime
*/
public function getChannelSentAt(): \DateTime
{
return $this->channelSentAt;
}
/**
* @param \DateTime $channelSentAt
*/
public function setChannelSentAt(\DateTime $channelSentAt)
{
$this->channelSentAt = $channelSentAt;
}
/**
* @return MessageOrder
*/
public function getOrder(): MessageOrder
{
return $this->order;
}
/**
* @param MessageOrder $order
*/
public function setOrder(MessageOrder $order)
{
$this->order = $order;
}
/**
* @return MessageProduct
*/
public function getProduct(): MessageProduct
{
return $this->product;
}
/**
* @param MessageProduct $product
*/
public function setProduct(MessageProduct $product)
{
$this->product = $product;
}
} }

View File

@ -13,46 +13,70 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageCost class. Schema: * MessageCost class
*
* | Field name | Data type |
* |------------|-----------|
* | currency | string |
* | value | float |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getCurrency() "Get `currency` value"
* @method $this setCurrency(string $value) "Set `currency` value"
* @method float getValue() "Get `value` value"
* @method $this setValue(float $value) "Set `value` value"
*/ */
class MessageCost extends LazyJsonMapper class MessageCost
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var float $value
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("float")
* $request = (new InfoRequest()) * @Accessor(getter="getValue",setter="setValue")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $value;
'currency' => 'string',
'value' => 'float' /**
]; * @var string $currency
*
* @Type("string")
* @Accessor(getter="getCurrency",setter="setCurrency")
*
* @Assert\Currency
*/
private $currency;
/**
* @return float
*/
public function getValue()
{
return $this->value;
}
/**
* @param float $value
*/
public function setValue(float $value)
{
$this->value = $value;
}
/**
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @param string $currency
*/
public function setCurrency(string $currency)
{
$this->currency = $currency;
}
} }

View File

@ -13,55 +13,122 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use Symfony\Component\Validator\Validation; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageDelivery class. Schema: * MessageDelivery class
*
* | Field name | Data type |
* |------------|-------------|
* | address | string |
* | comment | string |
* | name | string |
* | price | MessageCost |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getAddress() "Get `address` value"
* @method $this setAddress(string $value) "Set `address` value"
* @method string getComment() "Get `comment` value"
* @method $this setComment(string $value) "Set `comment` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method MessageCost getPrice() "Get `price` value"
* @method $this setPrice(MessageCost $value) "Set `price` value"
*/ */
class MessageDelivery extends LazyJsonMapper class MessageDelivery
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") *
* ->setRoles([...]); * @Assert\NotBlank
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'address' => 'string',
'comment' => 'string', /**
'name' => 'string', * @var MessageCost $price
'price' => 'MessageCost' *
]; * @Type("Cost")
* @Accessor(getter="getPrice",setter="setPrice")
*
* @Assert\Currency
*/
private $price;
/**
* @var string $address
*
* @Type("string")
* @Accessor(getter="getAddress",setter="setAddress")
* @SkipWhenEmpty()
*/
private $address;
/**
* @var string $comment
*
* @Type("string")
* @Accessor(getter="getComment",setter="setComment")
* @SkipWhenEmpty()
*/
private $comment;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return MessageCost
*/
public function getPrice()
{
return $this->price;
}
/**
* @param MessageCost $price
*/
public function setPrice(MessageCost $price)
{
$this->price = $price;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
*/
public function setAddress(string $address)
{
$this->address = $address;
}
/**
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* @param string $comment
*/
public function setComment(string $comment)
{
$this->comment = $comment;
}
} }

View File

@ -13,66 +13,232 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\Cost;
use RetailCrm\Mg\Bot\Model\Entity\Delivery;
use RetailCrm\Mg\Bot\Model\Entity\Status;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageOrder class. Schema: * MessageOrder class
*
* | Field name | Data type |
* |------------|--------------------|
* | cost | MessageCost |
* | date | string |
* | delivery | MessageDelivery |
* | items | array |
* | number | string |
* | payments | array |
* | status | MessageStatus |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method MessageCost getCost() "Get `cost` value"
* @method $this setCost(MessageCost $value) "Set `cost` value"
* @method string getDate() "Get `date` value"
* @method $this setDate(string $value) "Set `date` value"
* @method MessageDelivery getDelivery() "Get `delivery` value"
* @method $this setDelivery(MessageDelivery $value) "Set `delivery` value"
* @method array getItems() "Get `items` value"
* @method $this setItems(array $value) "Set `items` value"
* @method string getNumber() "Get `number` value"
* @method $this setNumber(string $value) "Set `number` value"
* @method array getPayments() "Get `payments` value"
* @method $this setPayments(array $value) "Set `payments` value"
* @method MessageStatus getStatus() "Get `status` value"
* @method $this setStatus(MessageStatus $value) "Set `status` value"
*/ */
class MessageOrder extends LazyJsonMapper class MessageOrder
{ {
// const JSON_PROPERTY_MAP = [
// 'cost' => 'MessageCost',
// 'date' => 'string',
// 'delivery' => 'MessageDelivery',
// 'items' => 'MessageOrderItem[]',
// 'number' => 'string',
// 'payments' => 'MessagePayment[]',
// 'status' => 'MessageStatus'
// ];
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $number
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getNumber",setter="setNumber")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $number;
'cost' => 'MessageCost',
'date' => 'string', /**
'delivery' => 'MessageDelivery', * @var string $url
'items' => 'MessageOrderItem[]', *
'number' => 'string', * @Type("string")
'payments' => 'MessagePayment[]', * @Accessor(getter="getUrl",setter="setUrl")
'status' => 'MessageStatus' * @SkipWhenEmpty()
]; */
private $url;
/**
* @var string $date
*
* @Type("string")
* @Accessor(getter="getDate",setter="setDate")
* @SkipWhenEmpty()
*/
private $date;
/**
* @var MessageCost $cost
*
* @Type("MessageCost")
* @Accessor(getter="getCost",setter="setCost")
* @SkipWhenEmpty()
*/
private $cost;
/**
* @var MessageStatus $status
*
* @Type("MessageStatus")
* @Accessor(getter="getStatus",setter="setStatus")
* @SkipWhenEmpty()
*/
private $status;
/**
* @var MessageDelivery $delivery
*
* @Type("MessageDelivery")
* @Accessor(getter="getDelivery",setter="setDelivery")
* @SkipWhenEmpty()
*/
private $delivery;
/**
* @var array $items
*
* @Type("array")
* @Accessor(getter="getItems",setter="setItems")
* @SkipWhenEmpty()
*/
private $items;
/**
* @var array $payments
*
* @Type("array")
* @Accessor(getter="getPayments",setter="setPayments")
* @SkipWhenEmpty()
*/
private $payments;
/**
* @return string
*/
public function getNumber()
{
return $this->number;
}
/**
* @param string $number
*/
public function setNumber(string $number)
{
$this->number = $number;
}
/**
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string $url
*/
public function setUrl(string $url)
{
$this->url = $url;
}
/**
* @return string
*/
public function getDate()
{
return $this->date;
}
/**
* @param string $date
*/
public function setDate(string $date)
{
$this->date = $date;
}
/**
* @return MessageCost
*/
public function getCost()
{
return $this->cost;
}
/**
* @param MessageCost $cost
*/
public function setCost(MessageCost $cost)
{
$this->cost = $cost;
}
/**
* @return MessageStatus
*/
public function getStatus()
{
return $this->status;
}
/**
* @param MessageStatus $status
*/
public function setStatus(MessageStatus $status)
{
$this->status = $status;
}
/**
* @return MessageDelivery
*/
public function getDelivery()
{
return $this->delivery;
}
/**
* @param MessageDelivery $delivery
*/
public function setDelivery(MessageDelivery $delivery)
{
$this->delivery = $delivery;
}
/**
* @return array
*/
public function getItems()
{
return $this->items;
}
/**
* @param array $items
*/
public function setItems(array $items)
{
$this->items = $items;
}
/**
* @return array
*/
public function getPayments()
{
return $this->payments;
}
/**
* @param array $payments
*/
public function setPayments(array $payments)
{
$this->payments = $payments;
}
} }

View File

@ -13,58 +13,144 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageOrderItem class. Schema: * MessageOrderItem class
*
* | Field name | Data type |
* |------------|-----------------|
* | img | string |
* | name | string |
* | price | MessageCost |
* | quantity | MessageQuantity |
* | url | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getImg() "Get `img` value"
* @method $this setImg(string $value) "Set `img` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method MessageCost getPrice() "Get `price` value"
* @method $this setPrice(MessageCost $value) "Set `price` value"
* @method MessageQuantity getQuantity() "Get `quantity` value"
* @method $this setQuantity(MessageQuantity $value) "Set `quantity` value"
* @method string getUrl() "Get `url` value"
* @method $this setUrl(string $value) "Set `url` value"
*/ */
class MessageOrderItem extends LazyJsonMapper class MessageOrderItem
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'img' => 'string',
'name' => 'string', /**
'price' => 'MessageCost', * @var string $url
'quantity' => 'MessageQuantity', *
'url' => 'string' * @Type("string")
]; * @Accessor(getter="getUrl",setter="setUrl")
* @SkipWhenEmpty()
*/
private $url;
/**
* @var string $img
*
* @Type("string")
* @Accessor(getter="getImg",setter="setImg")
* @SkipWhenEmpty()
*/
private $img;
/**
* @var MessageCost $price
*
* @Type("MessageCost")
* @Accessor(getter="getPrice",setter="setPrice")
* @SkipWhenEmpty()
*/
private $price;
/**
* @var MessageQuantity $quantity
*
* @Type("MessageQuantity")
* @Accessor(getter="getQuantity",setter="setQuantity)
* @SkipWhenEmpty()
*/
private $quantity;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string $url
*/
public function setUrl(string $url)
{
$this->url = $url;
}
/**
* @return string
*/
public function getImg()
{
return $this->img;
}
/**
* @param string $img
*/
public function setImg(string $img)
{
$this->img = $img;
}
/**
* @return MessageCost
*/
public function getPrice()
{
return $this->price;
}
/**
* @param MessageCost $price
*/
public function setPrice(MessageCost $price)
{
$this->price = $price;
}
/**
* @return MessageQuantity
*/
public function getQuantity()
{
return $this->quantity;
}
/**
* @param MessageQuantity $quantity
*/
public function setQuantity(MessageQuantity $quantity)
{
$this->quantity = $quantity;
}
} }

View File

@ -13,46 +13,72 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageOrderPaymentStatus class. Schema: * MessageOrderPaymentStatus class
*
* | Field name | Data type |
* |------------|-----------|
* | name | string |
* | payed | bool |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method bool getPayed() "Get `payed` value"
* @method $this setPayed(bool $value) "Set `payed` value"
*/ */
class MessageOrderPaymentStatus extends CommonFields class MessageOrderPaymentStatus
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'name' => 'string',
'payed' => 'bool' /**
]; * @var bool $name
*
* @Type("bool")
* @Accessor(getter="getPayed",setter="setPayed")
* @SkipWhenEmpty()
*/
private $payed;
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return bool
*/
public function isPayed(): bool
{
return $this->payed;
}
/**
* @param bool $payed
*/
public function setPayed(bool $payed)
{
$this->payed = $payed;
}
} }

View File

@ -13,50 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessagePayment class. Schema: * MessagePayment class
*
* | Field name | Data type |
* |------------|---------------------------|
* | amount | MessageCost |
* | name | string |
* | status | MessageOrderPaymentStatus |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method MessageCost getAmount() "Get `amount` value"
* @method $this setAmount(MessageCost $value) "Set `amount` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method MessageOrderPaymentStatus getStatus() "Get `status` value"
* @method $this setStatus(MessageOrderPaymentStatus $value) "Set `status` value"
*/ */
class MessagePayment extends CommonFields class MessagePayment
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'amount' => 'MessageCost',
'name' => 'string', /**
'status' => 'MessageOrderPaymentStatus' * @var MessageOrderPaymentStatus $status
]; *
* @Type("MessageOrderPaymentStatus")
* @Accessor(getter="getStatus",setter="setStatus")
* @SkipWhenEmpty()
*/
private $status;
/**
* @var MessageCost $amount
*
* @Type("MessageCost")
* @Accessor(getter="getAmount",setter="setAmount")
* @SkipWhenEmpty()
*/
private $amount;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return MessageOrderPaymentStatus
*/
public function getStatus()
{
return $this->status;
}
/**
* @param MessageOrderPaymentStatus $status
*/
public function setStatus(MessageOrderPaymentStatus $status)
{
$this->status = $status;
}
/**
* @return MessageCost
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param MessageCost $amount
*/
public function setAmount(MessageCost $amount)
{
$this->amount = $amount;
}
} }

View File

@ -13,66 +13,194 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageProduct class. Schema: * MessageProduct class
*
* | Field name | Data type |
* |------------|-----------------|
* | article | string |
* | cost | MessageCost |
* | id | int |
* | img | string |
* | name | string |
* | quantity | MessageQuantity |
* | url | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getArticle() "Get `article` value"
* @method $this setArticle(string $value) "Set `article` value"
* @method MessageCost getCost() "Get `cost` value"
* @method $this setCost(MessageCost $value) "Set `cost` value"
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getImg() "Get `img` value"
* @method $this setImg(string $value) "Set `img` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method MessageQuantity getQuantity() "Get `quantity` value"
* @method $this setQuantity(MessageQuantity $value) "Set `quantity` value"
* @method string getUrl() "Get `url` value"
* @method $this setUrl(string $value) "Set `url` value"
*/ */
class MessageProduct extends LazyJsonMapper class MessageProduct
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $id
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'article' => 'string',
'cost' => 'MessageCost', /**
'id' => 'int', * @var string $name
'img' => 'string', *
'name' => 'string', * @Type("string")
'quantity' => 'MessageQuantity', * @Accessor(getter="getName",setter="setName")
'url' => 'string' * @SkipWhenEmpty()
]; */
private $name;
/**
* @var string $article
*
* @Type("string")
* @Accessor(getter="getArticle",setter="setArticle")
* @SkipWhenEmpty()
*/
private $article;
/**
* @var string $url
*
* @Type("string")
* @Accessor(getter="getUrl",setter="setUrl")
* @SkipWhenEmpty()
*/
private $url;
/**
* @var string $img
*
* @Type("string")
* @Accessor(getter="getImg",setter="setImg")
* @SkipWhenEmpty()
*/
private $img;
/**
* @var MessageCost $cost
*
* @Type("Cost")
* @Accessor(getter="getCost",setter="setCost")
* @SkipWhenEmpty()
*/
private $cost;
/**
* @var MessageQuantity $quantity
*
* @Type("MessageQuantity")
* @Accessor(getter="getQuantity",setter="setQuantity)
* @SkipWhenEmpty()
*/
private $quantity;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getArticle(): string
{
return $this->article;
}
/**
* @param string $article
*/
public function setArticle(string $article)
{
$this->article = $article;
}
/**
* @return string
*/
public function getUrl(): string
{
return $this->url;
}
/**
* @param string $url
*/
public function setUrl(string $url)
{
$this->url = $url;
}
/**
* @return string
*/
public function getImg(): string
{
return $this->img;
}
/**
* @param string $img
*/
public function setImg(string $img)
{
$this->img = $img;
}
/**
* @return MessageCost
*/
public function getCost(): MessageCost
{
return $this->cost;
}
/**
* @param MessageCost $cost
*/
public function setCost(MessageCost $cost)
{
$this->cost = $cost;
}
/**
* @return MessageQuantity
*/
public function getQuantity(): MessageQuantity
{
return $this->quantity;
}
/**
* @param MessageQuantity $quantity
*/
public function setQuantity(MessageQuantity $quantity)
{
$this->quantity = $quantity;
}
} }

View File

@ -14,45 +14,72 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use RetailCrm\Mg\Bot\Model\Entity\CommonFields; use RetailCrm\Mg\Bot\Model\Entity\CommonFields;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageQuantity class. Schema: * MessageQuantity class
*
* | Field name | Data type |
* |------------|-----------|
* | unit | string |
* | value | float |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getUnit() "Get `unit` value"
* @method $this setUnit(string $value) "Set `unit` value"
* @method float getValue() "Get `value` value"
* @method $this setValue(float $value) "Set `value` value"
*/ */
class MessageQuantity extends CommonFields class MessageQuantity
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var float $value
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("float")
* $request = (new InfoRequest()) * @Accessor(getter="getValue",setter="setValue")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $value;
'unit' => 'string',
'value' => 'float' /**
]; * @var string $unit
*
* @Type("string")
* @Accessor(getter="getUnit",setter="setUnit")
*
* @Assert\Currency
*/
private $unit;
/**
* @return float
*/
public function getValue()
{
return $this->value;
}
/**
* @param float $value
*/
public function setValue(float $value)
{
$this->value = $value;
}
/**
* @return string
*/
public function getUnit()
{
return $this->unit;
}
/**
* @param string $unit
*/
public function setUnit(string $unit)
{
$this->unit = $unit;
}
} }

View File

@ -13,46 +13,69 @@
namespace RetailCrm\Mg\Bot\Model\Entity\Message; namespace RetailCrm\Mg\Bot\Model\Entity\Message;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageStatus class. Schema: * MessageStatus class
*
* | Field name | Data type |
* |------------|-----------|
* | code | string |
* | name | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity\Message * @package RetailCrm\Mg\Bot\Model\Entity\Message
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getCode() "Get `code` value"
* @method $this setCode(string $value) "Set `code` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
*/ */
class MessageStatus extends LazyJsonMapper class MessageStatus
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $code
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getCode",setter="setCode")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $code;
'code' => 'string',
'name' => 'string' /**
]; * @var string $name
*
* @Type("string")
* @Accessor(getter="getName",setter="setName")
* @SkipWhenEmpty()
*/
private $name;
/**
* @return string
*/
public function getCode(): string
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode(string $code)
{
$this->code = $code;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
} }

View File

@ -13,50 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Responsible class. Schema: * Responsible class
*
* | Field name | Data type |
* |-------------|-----------|
* | assigned_at | string |
* | id | int |
* | type | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getAssignedAt() "Get `assigned_at` value"
* @method $this setAssignedAt(string $value) "Set `assigned_at` value"
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
*/ */
class Responsible extends LazyJsonMapper class Responsible
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var \DateTime $assignedAt
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* $request = (new InfoRequest()) * @Accessor(getter="getAssignedAt",setter="setAssignedAt")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $assignedAt;
'assigned_at' => 'string',
'id' => 'int', /**
'type' => 'string' * @var int $id
]; *
* @Type("int")
* @Accessor(getter="getId",setter="setId")
* @SkipWhenEmpty()
*/
private $id;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @return \DateTime
*/
public function getAssignedAt(): \DateTime
{
return $this->assignedAt;
}
/**
* @param \DateTime $assignedAt
*/
public function setAssignedAt(\DateTime $assignedAt)
{
$this->assignedAt = $assignedAt;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
} }

View File

@ -13,76 +13,271 @@
namespace RetailCrm\Mg\Bot\Model\Entity; namespace RetailCrm\Mg\Bot\Model\Entity;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* User class. Schema: * User class
*
* | Field name | Data type |
* |-------------|-----------|
* | external_id | string |
* | type | string |
* | avatar | string |
* | name | string |
* | username | string |
* | first_name | string |
* | last_name | string |
* | is_active | bool |
* | is_online | bool |
* | revoked_at | string |
* *
* @package RetailCrm\Mg\Bot\Model\Entity * @package RetailCrm\Mg\Bot\Model\Entity
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getExternalId() "Get `external_id` value"
* @method $this setExternalId(string $value) "Set `external_id` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
* @method string getAvatar() "Get `avatar` value"
* @method $this setAvatar(string $value) "Set `avatar` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method string getUsername() "Get `username` value"
* @method $this setUsername(string $value) "Set `username` value"
* @method string getFirstName() "Get `first_name` value"
* @method $this setFirstName(string $value) "Set `first_name` value"
* @method string getLastName() "Get `last_name` value"
* @method $this setLastName(string $value) "Set `last_name` value"
* @method bool getIsActive() "Get `is_active` value"
* @method $this setIsActive(bool $value) "Set `is_active` value"
* @method bool getIsOnline() "Get `is_online` value"
* @method $this setIsOnline(bool $value) "Set `is_online` value"
* @method string getRevokedAt() "Get `revoked_at` value"
* @method $this setRevokedAt(string $value) "Set `revoked_at` value"
*/ */
class User extends CommonFields class User
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $externalId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getExternalId",setter="setExternalId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $externalId;
'external_id' => 'string',
'type' => 'string', /**
'avatar' => 'string', * @var string $type
'name' => 'string', *
'username' => 'string', * @Type("string")
'first_name' => 'string', * @Accessor(getter="getType",setter="setType")
'last_name' => 'string', * @SkipWhenEmpty()
'is_active' => 'bool', */
'is_online' => 'bool', private $type;
'revoked_at' => 'string'
]; /**
* @var string $avatar
*
* @Type("string")
* @Accessor(getter="getAvatar",setter="setAvatar")
* @SkipWhenEmpty()
*/
private $avatar;
/**
* @var string $name
*
* @Type("string")
* @Accessor(getter="getName",setter="setName")
* @SkipWhenEmpty()
*/
private $name;
/**
* @var string $username
*
* @Type("string")
* @Accessor(getter="getUsername",setter="setUsername")
* @SkipWhenEmpty()
*/
private $username;
/**
* @var string $firstName
*
* @Type("string")
* @Accessor(getter="getFirstName",setter="setFirstName")
* @SkipWhenEmpty()
*/
private $firstName;
/**
* @var string $lastName
*
* @Type("string")
* @Accessor(getter="getLastName",setter="setLastName")
* @SkipWhenEmpty()
*/
private $lastName;
/**
* @var bool $isActive
*
* @Type("bool")
* @Accessor(getter="getIsActive",setter="setIsActive")
* @SkipWhenEmpty()
*/
private $isActive;
/**
* @var bool $isOnline
*
* @Type("bool")
* @Accessor(getter="getIsOnline",setter="setIsOnline")
* @SkipWhenEmpty()
*/
private $isOnline;
/**
* @var \DateTime $revokedAt
*
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
* @Accessor(getter="getRevokedAt",setter="setRevokedAt")
* @SkipWhenEmpty()
*/
private $revokedAt;
/**
* @return string
*/
public function getExternalId(): string
{
return $this->externalId;
}
/**
* @param string $externalId
*/
public function setExternalId(string $externalId)
{
$this->externalId = $externalId;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getAvatar(): string
{
return $this->avatar;
}
/**
* @param string $avatar
*/
public function setAvatar(string $avatar)
{
$this->avatar = $avatar;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getUsername(): string
{
return $this->username;
}
/**
* @param string $username
*/
public function setUsername(string $username)
{
$this->username = $username;
}
/**
* @return string
*/
public function getFirstName(): string
{
return $this->firstName;
}
/**
* @param string $firstName
*/
public function setFirstName(string $firstName)
{
$this->firstName = $firstName;
}
/**
* @return string
*/
public function getLastName(): string
{
return $this->lastName;
}
/**
* @param string $lastName
*/
public function setLastName(string $lastName)
{
$this->lastName = $lastName;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->isActive;
}
/**
* @param bool $isActive
*/
public function setIsActive(bool $isActive)
{
$this->isActive = $isActive;
}
/**
* @return bool
*/
public function isOnline(): bool
{
return $this->isOnline;
}
/**
* @param bool $isOnline
*/
public function setIsOnline(bool $isOnline)
{
$this->isOnline = $isOnline;
}
/**
* @return \DateTime
*/
public function getRevokedAt(): \DateTime
{
return $this->revokedAt;
}
/**
* @param \DateTime $revokedAt
*/
public function setRevokedAt(\DateTime $revokedAt)
{
$this->revokedAt = $revokedAt;
}
} }

View File

@ -13,48 +13,90 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* BotsRequest class. Parameters: * BotsRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | active | int |
* | self | int |
* | roles | array |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getActive() "Get `active` value"
* @method $this setActive(int $value) "Set `active` value"
* @method int getSelf() "Get `self` value"
* @method $this setSelf(int $value) "Set `self` value"
* @method array getRoles() "Get `roles` value"
* @method $this setRoles(array $value) "Set `roles` value"
*/ */
class BotsRequest extends CommonFields class BotsRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("int")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getActive",setter="setActive")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $active;
'active' => 'int',
'self' => 'int', /**
'roles' => 'string[]' * @Type("int")
]; * @Accessor(getter="getSelf",setter="setSelf")
* @SkipWhenEmpty
*/
private $self;
/**
* @Type("array")
* @Accessor(getter="getRoles",setter="setRoles")
* @SkipWhenEmpty
*/
private $roles;
/**
* @return int
*/
public function getSelf()
{
return $this->self;
}
/**
* @param int $self
*/
public function setSelf($self)
{
$this->self = $self;
}
/**
* @return int
*/
public function getActive()
{
return $this->active;
}
/**
* @param int $active
*/
public function setActive($active)
{
$this->active = $active;
}
/**
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* @param array $roles
*/
public function setRoles($roles)
{
$this->roles = $roles;
}
} }

View File

@ -13,44 +13,67 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChannelsRequest class. Parameters: * ChannelsRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | types | array |
* | active | int |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method array getTypes() "Get `types` value"
* @method $this setTypes(array $value) "Set `types` value"
* @method int getActive() "Get `active` value"
* @method $this setActive(int $value) "Set `active` value"
*/ */
class ChannelsRequest extends CommonFields class ChannelsRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("array")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getTypes",setter="setTypes")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $types;
'types' => 'string[]',
'active' => 'int' /**
]; * @Type("int")
* @Accessor(getter="getActive",setter="setActive")
* @SkipWhenEmpty
*/
private $active;
/**
* @return array
*/
public function getTypes()
{
return $this->types;
}
/**
* @param array $types
*/
public function setTypes($types)
{
$this->types = $types;
}
/**
* @return int
*/
public function getActive()
{
return $this->active;
}
/**
* @param int $active
*/
public function setActive($active)
{
$this->active = $active;
}
} }

View File

@ -13,44 +13,67 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ChatsRequest class. Parameters: * ChatsRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | channel_id | int |
* | channel_type | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getChannelId() "Get `channel_id` value"
* @method $this setChannelId(int $value) "Set `channel_id` value"
* @method string getChannelType() "Get `channel_type` value"
* @method $this setChannelType(string $value) "Set `channel_type` value"
*/ */
class ChatsRequest extends CommonFields class ChatsRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("int")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getChannelId",setter="setChannelId")
* ``` * @SkipWhenEmpty()
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $channelId;
'channel_id' => 'int',
'channel_type' => 'string' /**
]; * @Type("string")
* @Accessor(getter="getChannelType",setter="setChannelType")
* @SkipWhenEmpty()
*/
private $channelType;
/**
* @return int
*/
public function getChannelId()
{
return $this->channelId;
}
/**
* @param int $channelId
*/
public function setChannelId($channelId)
{
$this->channelId = $channelId;
}
/**
* @return string
*/
public function getChannelType()
{
return $this->channelType;
}
/**
* @param string $channelType
*/
public function setChannelType($channelType)
{
$this->channelType = $channelType;
}
} }

View File

@ -13,57 +13,97 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* CommandEditRequest class. Parametres: * CommandEditRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | bot_id | int |
* | name | string |
* | description | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getBotId() "Get `bot_id` value"
* @method $this setBotId(int $value) "Set `bot_id` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method string getDescription() "Get `description` value"
* @method $this setDescription(string $value) "Set `description` value"
*/ */
class CommandEditRequest extends LazyJsonMapper class CommandEditRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $botId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getBotId",setter="setBotId")
* ->setName("...") *
* ->setRoles([...]); * @Assert\NotBlank
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $botId;
'bot_id' => 'int',
'name' => 'string',
'description' => 'string'
];
public function validate() /**
* @var string $name
*
* @Type("string")
* @Accessor(getter="getName",setter="setName")
*
* @Assert\NotBlank
*/
private $name;
/**
* @var string $description
*
* @Type("string")
* @Accessor(getter="getDescription",setter="setDescription")
* @SkipWhenEmpty
*/
private $description;
/**
* @return string
*/
public function getName()
{ {
if (empty($this->getName())) { return $this->name;
return 'Empty name';
} }
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
*/
public function setDescription(string $description)
{
$this->description = $description;
}
/**
* @return int
*/
public function getBotId()
{
return $this->botId;
}
/**
* @param int $botId
*/
public function setBotId(int $botId)
{
$this->botId = $botId;
} }
} }

View File

@ -13,40 +13,44 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* CommandsRequest class. Parametres: * CommandsRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | name | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
*/ */
class CommandsRequest extends CommonFields class CommandsRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("string")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getName",setter="setName")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'name' => 'string'
]; /**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
} }

View File

@ -13,50 +13,88 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* CommonFields class. Parametres: * CommonFields trait
*
* | Parameter name | Data type |
* |----------------|-----------|
* | id | int |
* | since | string |
* | until | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getSince() "Get `since` value"
* @method $this setSince(string $value) "Set `since` value"
* @method string getUntil() "Get `until` value"
* @method $this setUntil(string $value) "Set `until` value"
*/ */
class CommonFields extends LazyJsonMapper trait CommonFields
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("int")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getId",setter="setId")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'int',
'since' => 'string', /**
'until' => 'string' * @Type("string")
]; * @Accessor(getter="getSince",setter="setSince")
* @SkipWhenEmpty
*/
private $since;
/**
* @Type("string")
* @Accessor(getter="getUntil",setter="setUntil")
* @SkipWhenEmpty
*/
private $until;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getSince()
{
return $this->since;
}
/**
* @param string $since
*/
public function setSince($since)
{
$this->since = $since;
}
/**
* @return string
*/
public function getUntil()
{
return $this->until;
}
/**
* @param string $until
*/
public function setUntil($until)
{
$this->until = $until;
}
} }

View File

@ -13,40 +13,45 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Request\CommonFields;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* CustomersRequest class. Parametres: * CustomersRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | external_id | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getExternalId() "Get `external_id` value"
* @method $this setExternalId(string $value) "Set `external_id` value"
*/ */
class CustomersRequest extends CommonFields class CustomersRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("string")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getExternalId",setter="setExternalId")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $externalId;
'external_id' => 'string'
]; /**
* @return string
*/
public function getExternalId()
{
return $this->externalId;
}
/**
* @param string $externalId
*/
public function setExternalId($externalId)
{
$this->externalId = $externalId;
}
} }

View File

@ -13,50 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* DialogAssignRequest class. Parameters: * DialogAssignRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | dialog_id | int |
* | user_id | int |
* | bot_id | int |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getDialogId() "Get `dialog_id` value"
* @method $this setDialogId(int $value) "Set `dialog_id` value"
* @method int getUserId() "Get `user_id` value"
* @method $this setUserId(int $value) "Set `user_id` value"
* @method int getBotId() "Get `bot_id` value"
* @method $this setBotId(int $value) "Set `bot_id` value"
*/ */
class DialogAssignRequest extends LazyJsonMapper class DialogAssignRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $dialogId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getDialogId,setter="setDialogId")
* ->setName("...") * @SkipWhenEmpty
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $dialogId;
'dialog_id' => 'int',
'user_id' => 'int', /**
'bot_id' => 'int' * @var int $userId
]; *
* @Type("int")
* @Accessor(getter="getUserId",setter="setUserId")
* @SkipWhenEmpty
*/
private $userId;
/**
* @var int $botId
*
* @Type("int")
* @Accessor(getter="getBotId",setter="setBotId")
* @SkipWhenEmpty()
*/
private $botId;
/**
* @return int
*/
public function getDialogId()
{
return $this->dialogId;
}
/**
* @param int $dialogId
*/
public function setDialogId(int $dialogId)
{
$this->dialogId = $dialogId;
}
/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
*/
public function setUserId(int $userId)
{
$this->userId = $userId;
}
/**
* @return int
*/
public function getBotId()
{
return $this->botId;
}
/**
* @param int $botId
*/
public function setBotId(int $botId)
{
$this->botId = $botId;
}
} }

View File

@ -13,56 +13,146 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* DialogsRequest class. Parametres: * DialogsRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | chat_id | int |
* | user_id | int |
* | bot_id | int |
* | active | int |
* | assign | int |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getUserId() "Get `user_id` value"
* @method $this setUserId(int $value) "Set `user_id` value"
* @method int getBotId() "Get `bot_id` value"
* @method $this setBotId(int $value) "Set `bot_id` value"
* @method int getActive() "Get `active` value"
* @method $this setActive(int $value) "Set `active` value"
* @method int getAssign() "Get `assign` value"
* @method $this setAssign(int $value) "Set `assign` value"
*/ */
class DialogsRequest extends CommonFields class DialogsRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $chatId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getChatId",setter="setChatId")
* ->setName("...") * @SkipWhenEmpty
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $chatId;
'chat_id' => 'int',
'user_id' => 'int', /**
'bot_id' => 'int', * @var int $userId
'active' => 'int', *
'assign' => 'int' * @Type("int")
]; * @Accessor(getter="getUserId",setter="setUserId")
* @SkipWhenEmpty
*/
private $userId;
/**
* @var int $botId
*
* @Type("int")
* @Accessor(getter="getBotId",setter="setBotId")
* @SkipWhenEmpty()
*/
private $botId;
/**
* @var int $active
*
* @Type("int")
* @Accessor(getter="getActive",setter="setActive")
* @SkipWhenEmpty
*/
private $active;
/**
* @var int $assign
*
* @Type("int")
* @Accessor(getter="getAssign",setter="setAssign")
* @SkipWhenEmpty
*/
private $assign;
/**
* @return int
*/
public function getChatId()
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
*/
public function setUserId(int $userId)
{
$this->userId = $userId;
}
/**
* @return int
*/
public function getBotId()
{
return $this->botId;
}
/**
* @param int $botId
*/
public function setBotId(int $botId)
{
$this->botId = $botId;
}
/**
* @return int
*/
public function getActive()
{
return $this->active;
}
/**
* @param int $active
*/
public function setActive(int $active)
{
$this->active = $active;
}
/**
* @return int
*/
public function getAssign()
{
return $this->assign;
}
/**
* @param int $assign
*/
public function setAssign(int $assign)
{
$this->assign = $assign;
}
} }

View File

@ -13,50 +13,94 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* InfoRequest class. Parameters: * InfoRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | name | string |
* | avatarUrl | string |
* | roles | array |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method string getAvatarUrl() "Get `avatarUrl` value"
* @method $this setAvatarUrl(string $value) "Set `avatarUrl` value"
* @method array getRoles() "Get `roles` value"
* @method $this setRoles(array $value) "Set `roles` value"
*/ */
class InfoRequest extends LazyJsonMapper class InfoRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $name
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getName",setter="setName")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $name;
'name' => 'string',
'avatarUrl' => 'string', /**
'roles' => 'string[]' * @var string $avatarUrl
]; *
* @Type("string")
* @Accessor(getter="getAvatarUrl",setter="setAvatarUrl")
* @SkipWhenEmpty()
*/
private $avatarUrl;
/**
* @var array $roles
*
* @Type("array")
* @Accessor(getter="getRoles",setter="setRoles")
* @SkipWhenEmpty()
*/
private $roles;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getAvatarUrl()
{
return $this->avatarUrl;
}
/**
* @param string $avatarUrl
*/
public function setAvatarUrl(string $avatarUrl)
{
$this->avatarUrl = $avatarUrl;
}
/**
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* @param array $roles
*/
public function setRoles(array $roles)
{
$this->roles = $roles;
}
} }

View File

@ -13,58 +13,144 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MembersRequest class. Parameters: * MembersRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | chat_id | int |
* | user_id | int |
* | state | string |
* | since | string |
* | until | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getUserId() "Get `user_id` value"
* @method $this setUserId(int $value) "Set `user_id` value"
* @method string getState() "Get `state` value"
* @method $this setState(string $value) "Set `state` value"
* @method string getSince() "Get `since` value"
* @method $this setSince(string $value) "Set `since` value"
* @method string getUntil() "Get `until` value"
* @method $this setUntil(string $value) "Set `until` value"
*/ */
class MembersRequest extends LazyJsonMapper class MembersRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $chatId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getChatId",setter="setChatId")
* ->setName("...") * @SkipWhenEmpty
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $chatId;
'chat_id' => 'int',
'user_id' => 'int', /**
'state' => 'string', * @var int $userId
'since' => 'string', *
'until' => 'string' * @Type("int")
]; * @Accessor(getter="getUserId",setter="setUserId")
* @SkipWhenEmpty
*/
private $userId;
/**
* @var string $state
*
* @Type("string")
* @Accessor(getter="getState",setter="setState")
* @SkipWhenEmpty
*/
private $state;
/**
* @var string $since
*
* @Type("string")
* @Accessor(getter="getSince",setter="setSince")
* @SkipWhenEmpty
*/
private $since;
/**
* @var string $until
*
* @Type("string")
* @Accessor(getter="getUntil",setter="setUntil")
* @SkipWhenEmpty
*/
private $until;
/**
* @return int
*/
public function getChatId()
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
*/
public function setUserId(int $userId)
{
$this->userId = $userId;
}
/**
* @return string
*/
public function getState()
{
return $this->state;
}
/**
* @param string $state
*/
public function setState(string $state)
{
$this->state = $state;
}
/**
* @return string
*/
public function getSince()
{
return $this->since;
}
/**
* @param string $since
*/
public function setSince(string $since)
{
$this->since = $since;
}
/**
* @return string
*/
public function getUntil()
{
return $this->until;
}
/**
* @param string $until
*/
public function setUntil(string $until)
{
$this->until = $until;
}
} }

View File

@ -13,46 +13,69 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageEditRequest class. Parameters: * MessageEditRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | id | int |
* | content | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getId() "Get `id` value"
* @method $this setId(int $value) "Set `id` value"
* @method string getContent() "Get `content` value"
* @method $this setContent(string $value) "Set `content` value"
*/ */
class MessageEditRequest extends LazyJsonMapper class MessageEditRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $id
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'int',
'content' => 'string' /**
]; * @var string $content
*
* @Type("string")
* @Accessor(getter="getContent",setter="setContent")
* @SkipWhenEmpty()
*/
private $content;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* @param string $content
*/
public function setContent(string $content)
{
$this->content = $content;
}
} }

View File

@ -13,72 +13,227 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
use RetailCrm\Mg\Bot\Model\Entity\Order; use RetailCrm\Mg\Bot\Model\Entity\Order;
use RetailCrm\Mg\Bot\Model\Entity\Product; use RetailCrm\Mg\Bot\Model\Entity\Product;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageSendRequest class. Parameters: * MessageSendRequest class
*
* | Parameter name | Data type |
* |------------------|----------------|
* | type | string |
* | content | string |
* | product | MessageProduct |
* | order | MessageOrder |
* | items | array |
* | scope | string |
* | chat_id | int |
* | quote_message_id | int |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
* @method string getContent() "Get `content` value"
* @method $this setContent(string $value) "Set `content` value"
* @method MessageProduct getProduct() "Get `product` value"
* @method $this setProduct(MessageProduct $value) "Set `product` value"
* @method MessageOrder getOrder() "Get `order` value"
* @method $this setOrder(MessageOrder $value) "Set `order` value"
* @method array getItems() "Get `items` value"
* @method $this setItems(array $value) "Set `items` value"
* @method string getScope() "Get `scope` value"
* @method $this setScope(string $value) "Set `scope` value"
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getQuoteMessageId() "Get `quote_message_id` value"
* @method $this setQuoteMessageId(int $value) "Set `quote_message_id` value"
*/ */
class MessageSendRequest extends LazyJsonMapper class MessageSendRequest
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $type
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getType",setter="setType")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $type;
'type' => 'string',
'content' => 'string', /**
'product' => '\RetailCrm\Mg\Bot\Model\Entity\Message\MessageProduct', * @var string $content
'order' => '\RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrder', *
'items' => '\RetailCrm\Mg\Bot\Model\Entity\Message\Item[]', * @Type("string")
'scope' => 'string', * @Accessor(getter="getContent",setter="setContent")
'chat_id' => 'int', *
'quote_message_id' => 'int' * @Assert\NotBlank
]; */
private $content;
/**
* @var Product $product
*
* @Type("Product")
* @Accessor(getter="getProduct",setter="setProduct")
* @SkipWhenEmpty()
*/
private $product;
/**
* @var Order $order
*
* @Type("Order")
* @Accessor(getter="getOrder",setter="setOrder")
* @SkipWhenEmpty()
*/
private $order;
/**
* @var array $items
*
* @Type("array")
* @Accessor(getter="getItems",setter="setItems")
* @SkipWhenEmpty()
*/
private $items;
/**
* @var string $scope
*
* @Type("string")
* @Accessor(getter="getScope",setter="setScope")
*
* @Assert\NotBlank
*/
private $scope;
/**
* @var int $chatId
*
* @Type("int")
* @Accessor(getter="getChatId",setter="setChatId")
*
* @Assert\NotBlank
*/
private $chatId;
/**
* @var int $quoteMessageId
*
* @Type("int")
* @Accessor(getter="getQuoteMessageId",setter="setQuoteMessageId")
* @SkipWhenEmpty
*/
private $quoteMessageId;
/**
* @return int
*/
public function getChatId()
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return string
*/
public function getScope()
{
return $this->scope;
}
/**
* @param string $scope
*/
public function setScope(string $scope)
{
$this->scope = $scope;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* @param string $content
*/
public function setContent(string $content)
{
$this->content = $content;
}
/**
* @return Product
*/
public function getProduct()
{
return $this->product;
}
/**
* @param Product $product
*/
public function setProduct(Product $product)
{
$this->product = $product;
}
/**
* @return Order
*/
public function getOrder()
{
return $this->order;
}
/**
* @param Order $order
*/
public function setOrder(Order $order)
{
$this->order = $order;
}
/**
* @return array
*/
public function getItems()
{
return $this->items;
}
/**
* @param array $items
*/
public function setItems(array $items)
{
$this->items = $items;
}
/**
* @return int
*/
public function getQuoteMessageId()
{
return $this->quoteMessageId;
}
/**
* @param int $quoteMessageId
*/
public function setQuoteMessageId(int $quoteMessageId)
{
$this->quoteMessageId = $quoteMessageId;
}
} }

View File

@ -13,72 +13,246 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessagesRequest class. Parameters: * MessagesRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | chat_id | int |
* | dialog_id | int |
* | user_id | int |
* | customer_id | int |
* | bot_id | int |
* | channel_id | int |
* | channel_type | string |
* | scope | string |
* | type | string |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getChatId() "Get `chat_id` value"
* @method $this setChatId(int $value) "Set `chat_id` value"
* @method int getDialogId() "Get `dialog_id` value"
* @method $this setDialogId(int $value) "Set `dialog_id` value"
* @method int getUserId() "Get `user_id` value"
* @method $this setUserId(int $value) "Set `user_id` value"
* @method int getCustomerId() "Get `customer_id` value"
* @method $this setCustomerId(int $value) "Set `customer_id` value"
* @method int getBotId() "Get `bot_id` value"
* @method $this setBotId(int $value) "Set `bot_id` value"
* @method int getChannelId() "Get `channel_id` value"
* @method $this setChannelId(int $value) "Set `channel_id` value"
* @method string getChannelType() "Get `channel_type` value"
* @method $this setChannelType(string $value) "Set `channel_type` value"
* @method string getScope() "Get `scope` value"
* @method $this setScope(string $value) "Set `scope` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
*/ */
class MessagesRequest extends CommonFields class MessagesRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $chatId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getChatId",setter="setChatId")
* ->setName("...") * @SkipWhenEmpty
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $chatId;
'chat_id' => 'int',
'dialog_id' => 'int', /**
'user_id' => 'int', * @var int $dialogId
'customer_id' => 'int', *
'bot_id' => 'int', * @Type("int")
'channel_id' => 'int', * @Accessor(getter="getDialogId",setter="setDialogId")
'channel_type' => 'string', * @SkipWhenEmpty
'scope' => 'string', */
'type' => 'string' private $dialogId;
];
/**
* @var int $userId
*
* @Type("int")
* @Accessor(getter="getUserId",setter="setUserId")
* @SkipWhenEmpty
*/
private $userId;
/**
* @var int $customerId
*
* @Type("int")
* @Accessor(getter="getCustomerId",setter="setCustomerId")
* @SkipWhenEmpty()
*/
private $customerId;
/**
* @var int $botId
*
* @Type("int")
* @Accessor(getter="getBotId",setter="setBotId")
* @SkipWhenEmpty()
*/
private $botId;
/**
* @var int $channelId
*
* @Type("int")
* @Accessor(getter="getChannelId",setter="setChannelId")
* @SkipWhenEmpty()
*/
private $channelId;
/**
* @var string $channelType
*
* @Type("string")
* @Accessor(getter="getChannelType",setter="setChannelType")
* @SkipWhenEmpty()
*/
private $channelType;
/**
* @var string $scope
*
* @Type("string")
* @Accessor(getter="getScope",setter="setScope")
* @SkipWhenEmpty()
*/
private $scope;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @return int
*/
public function getChatId()
{
return $this->chatId;
}
/**
* @param int $chatId
*/
public function setChatId(int $chatId)
{
$this->chatId = $chatId;
}
/**
* @return int
*/
public function getDialogId()
{
return $this->dialogId;
}
/**
* @param int $dialogId
*/
public function setDialogId(int $dialogId)
{
$this->dialogId = $dialogId;
}
/**
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* @param int $userId
*/
public function setUserId(int $userId)
{
$this->userId = $userId;
}
/**
* @return int
*/
public function getCustomerId()
{
return $this->customerId;
}
/**
* @param int $customerId
*/
public function setCustomerId(int $customerId)
{
$this->customerId = $customerId;
}
/**
* @return int
*/
public function getBotId()
{
return $this->botId;
}
/**
* @param int $botId
*/
public function setBotId(int $botId)
{
$this->botId = $botId;
}
/**
* @return int
*/
public function getChannelId()
{
return $this->channelId;
}
/**
* @param int $channelId
*/
public function setChannelId(int $channelId)
{
$this->channelId = $channelId;
}
/**
* @return string
*/
public function getChannelType()
{
return $this->channelType;
}
/**
* @param string $channelType
*/
public function setChannelType(string $channelType)
{
$this->channelType = $channelType;
}
/**
* @return string
*/
public function getScope()
{
return $this->scope;
}
/**
* @param string $scope
*/
public function setScope(string $scope)
{
$this->scope = $scope;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
} }

View File

@ -13,48 +13,90 @@
namespace RetailCrm\Mg\Bot\Model\Request; namespace RetailCrm\Mg\Bot\Model\Request;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* UsersRequest class. Parameters: * UsersRequest class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | external_id | string |
* | active | int |
* | online | int |
* *
* @package RetailCrm\Mg\Bot\Model\Request * @package RetailCrm\Mg\Bot\Model\Request
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getExternalId() "Get `external_id` value"
* @method $this setExternalId(string $value) "Set `external_id` value"
* @method int getActive() "Get `active` value"
* @method $this setActive(int $value) "Set `active` value"
* @method int getOnline() "Get `online` value"
* @method $this setOnline(int $value) "Set `online` value"
*/ */
class UsersRequest extends CommonFields class UsersRequest
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @Type("string")
* Setters will return model instance, so you can construct any model like this: * @Accessor(getter="getExternalId",setter="setExternalId")
* ``` * @SkipWhenEmpty
* $request = (new InfoRequest())
* ->setName("...")
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $externalId;
'external_id' => 'string',
'active' => 'int', /**
'online' => 'int' * @Type("int")
]; * @Accessor(getter="getActive",setter="setActive")
* @SkipWhenEmpty
*/
private $active;
/**
* @Type("int")
* @Accessor(getter="getOnline",setter="setOnline")
* @SkipWhenEmpty
*/
private $online;
/**
* @return string
*/
public function getExternalId()
{
return $this->externalId;
}
/**
* @param string $externalId
*/
public function setExternalId($externalId)
{
$this->externalId = $externalId;
}
/**
* @return int
*/
public function getActive()
{
return $this->active;
}
/**
* @param int $active
*/
public function setActive($active)
{
$this->active = $active;
}
/**
* @return int
*/
public function getOnline()
{
return $this->online;
}
/**
* @param int $online
*/
public function setOnline($online)
{
$this->online = $online;
}
} }

View File

@ -13,54 +13,122 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\Responsible; use RetailCrm\Mg\Bot\Model\Entity\Responsible;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* AssignResponse class. Parameters: * AssignResponse class
*
* | Parameter name | Data type |
* |----------------------|-------------|
* | is_reassign | bool |
* | left_manager_id | int |
* | previous_responsible | Responsible |
* | responsible | Responsible |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method bool getIsReassign() "Get `is_reassign` value"
* @method $this setIsReassign(bool $value) "Set `is_reassign` value"
* @method int getLeftManagerId() "Get `left_manager_id` value"
* @method $this setLeftManagerId(int $value) "Set `left_manager_id` value"
* @method Responsible getPreviousResponsible() "Get `previous_responsible` value"
* @method $this setPreviousResponsible(Responsible $value) "Set `previous_responsible` value"
* @method Responsible getResponsible() "Get `responsible` value"
* @method $this setResponsible(Responsible $value) "Set `responsible` value"
*/ */
class AssignResponse extends CommonFields class AssignResponse
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var bool $isReassign
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("bool")
* $request = (new InfoRequest()) * @Accessor(getter="getIsReassign",setter="setIsReassign")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $isReassign;
'is_reassign' => 'bool',
'left_manager_id' => 'int', /**
'previous_responsible' => 'Responsible', * @var int $leftManagerId
'responsible' => 'Responsible' *
]; * @Type("int")
* @Accessor(getter="getLeftManagerId",setter="setLeftManagerId")
* @SkipWhenEmpty()
*/
private $leftManagerId;
/**
* @var Responsible $previousResponsible
*
* @Type("Responsible")
* @Accessor(getter="getPreviousResponsible",setter="setPreviousResponsible")
* @SkipWhenEmpty()
*/
private $previousResponsible;
/**
* @var Responsible $responsible
*
* @Type("Responsible")
* @Accessor(getter="getResponsible",setter="setResponsible")
* @SkipWhenEmpty()
*/
private $responsible;
/**
* @return bool
*/
public function isReassign(): bool
{
return $this->isReassign;
}
/**
* @param bool $isReassign
*/
public function setIsReassign(bool $isReassign)
{
$this->isReassign = $isReassign;
}
/**
* @return int
*/
public function getLeftManagerId(): int
{
return $this->leftManagerId;
}
/**
* @param int $leftManagerId
*/
public function setLeftManagerId(int $leftManagerId)
{
$this->leftManagerId = $leftManagerId;
}
/**
* @return Responsible
*/
public function getPreviousResponsible(): Responsible
{
return $this->previousResponsible;
}
/**
* @param Responsible $previousResponsible
*/
public function setPreviousResponsible(Responsible $previousResponsible)
{
$this->previousResponsible = $previousResponsible;
}
/**
* @return Responsible
*/
public function getResponsible(): Responsible
{
return $this->responsible;
}
/**
* @param Responsible $responsible
*/
public function setResponsible(Responsible $responsible)
{
$this->responsible = $responsible;
}
} }

View File

@ -13,51 +13,52 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use RetailCrm\Mg\Bot\Model\Entity\Error; use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Error trait. Parameters: * CommonFields trait
*
* | Parameter name | Data type |
* |----------------|-----------|
* | errors | array |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method array getErrors() "Get `errors` value"
* @method $this setErrors(array $value) "Set `errors` value"
*/ */
class CommonFields extends LazyJsonMapper trait CommonFields
{ {
/** /**
* JSON fields. Use setters and getters to work with this values. * @var array $errors
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("array")
* $request = (new InfoRequest()) * @Accessor(getter="getErrors",setter="setErrors")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $errors;
'errors' => 'string[]'
]; /**
* @return array
*/
public function getErrors(): array
{
return $this->errors;
}
/**
* @param array $errors
*/
public function setErrors(array $errors)
{
$this->errors = $errors;
}
/** /**
* @return bool * @return bool
*/ */
public function isError() public function isSuccessful()
{ {
return (bool) !empty($this->getErrors()); return (bool) empty($this->getErrors());
} }
} }

View File

@ -23,4 +23,6 @@ namespace RetailCrm\Mg\Bot\Model\Response;
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*/ */
class ErrorOnlyResponse extends CommonFields {} class ErrorOnlyResponse {
use CommonFields;
}

View File

@ -13,52 +13,121 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* FullFileResponse class. Parameters: * FullFileResponse class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | id | string |
* | size | int |
* | type | string |
* | url | string |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getId() "Get `id` value"
* @method $this setId(string $value) "Set `id` value"
* @method int getSize() "Get `size` value"
* @method $this setSize(int $value) "Set `size` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
* @method string getUrl() "Get `url` value"
* @method $this setUrl(string $value) "Set `url` value"
*/ */
class FullFileResponse extends CommonFields class FullFileResponse
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $id
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getId",setter="setId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $id;
'id' => 'string',
'size' => 'int', /**
'type' => 'string', * @var int $size
'url' => 'string' *
]; * @Type("int")
* @Accessor(getter="getSize",setter="setSize")
* @SkipWhenEmpty()
*/
private $size;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @var string $url
*
* @Type("string")
* @Accessor(getter="getUrl",setter="setUrl")
* @SkipWhenEmpty()
*/
private $url;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id)
{
$this->id = $id;
}
/**
* @return int
*/
public function getSize(): int
{
return $this->size;
}
/**
* @param int $size
*/
public function setSize(int $size)
{
$this->size = $size;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
/**
* @return string
*/
public function getUrl(): string
{
return $this->url;
}
/**
* @param string $url
*/
public function setUrl(string $url)
{
$this->url = $url;
}
} }

View File

@ -13,32 +13,13 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use RetailCrm\Common\Serializer;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* ListResponse class. * ListResponse class. Used to store multiple objects at once.
* * Implements `Iterator`, `ArrayAccess` and `Countable`.
* This class implements `ArrayAccess` and `Iterator` interfaces.
* It means you can access items using array syntax, or use this class in `foreach` loop.
*
* Example:
* ```
* $request = new \RetailCrm\Mg\Bot\Model\Request\BotsRequest();
* $request->setActive(1);
* $request->setRoles([Constants::BOT_ROLE_RESPONSIBLE]);
*
* $data = $client->bots($request);
* $firstBot = $data[0];
*
* foreach($data as $bot) { ... }
* ```
*
* Fields:
*
* | Field name | Data type |
* |----------------|---------------|
* | result | array[object] |
* | errors | array[string] |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
@ -73,7 +54,11 @@ class ListResponse implements \Iterator, \ArrayAccess, \Countable {
$this->errors = $data['errors']; $this->errors = $data['errors'];
} else { } else {
foreach($data as $item) { foreach($data as $item) {
$this->items[] = new $responseType($item); if (substr($responseType, 0, 1) == '\\') {
$responseType = substr($responseType, 1);
}
$this->items[] = Serializer::deserialize($item, $responseType, Serializer::S_ARRAY);
} }
} }
} }

View File

@ -13,44 +13,71 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* MessageSendResponse class. Parameters: * MessageSendResponse class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | message_id | int |
* | time | string |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method int getMessageId() "Get `message_id` value"
* @method $this setMessageId(int $value) "Set `message_id` value"
* @method string getTime() "Get `time` value"
* @method $this setTime(string $value) "Set `time` value"
*/ */
class MessageSendResponse extends CommonFields class MessageSendResponse
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var int $messageId
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("int")
* $request = (new InfoRequest()) * @Accessor(getter="getMessageId",setter="setMessageId")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $messageId;
'message_id' => 'int',
'time' => 'string' /**
]; * @var string $time
*
* @Type("string")
* @Accessor(getter="getTime",setter="setTime")
* @SkipWhenEmpty()
*/
private $time;
/**
* @return int
*/
public function getMessageId(): int
{
return $this->messageId;
}
/**
* @param int $messageId
*/
public function setMessageId(int $messageId)
{
$this->messageId = $messageId;
}
/**
* @return string
*/
public function getTime(): string
{
return $this->time;
}
/**
* @param string $time
*/
public function setTime(string $time)
{
$this->time = $time;
}
} }

View File

@ -13,70 +13,222 @@
namespace RetailCrm\Mg\Bot\Model\Response; namespace RetailCrm\Mg\Bot\Model\Response;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use RetailCrm\Mg\Bot\Model\Entity\FileMeta; use RetailCrm\Mg\Bot\Model\Entity\FileMeta;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* UploadFileResponse class. Parameters: * UploadFileResponse class
*
* | Parameter name | Data type |
* |----------------|-----------|
* | created_at | string |
* | hash | string |
* | id | string |
* | meta | FileMeta |
* | mime_type | string |
* | size | int |
* | source_url | string |
* | type | string |
* *
* @package RetailCrm\Mg\Bot\Model\Response * @package RetailCrm\Mg\Bot\Model\Response
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getCreatedAt() "Get `created_at` value"
* @method $this setCreatedAt(string $value) "Set `created_at` value"
* @method string getHash() "Get `hash` value"
* @method $this setHash(string $value) "Set `hash` value"
* @method string getId() "Get `id` value"
* @method $this setId(string $value) "Set `id` value"
* @method FileMeta getMeta() "Get `meta` value"
* @method $this setMeta(FileMeta $value) "Set `meta` value"
* @method string getMimeType() "Get `mime_type` value"
* @method $this setMimeType(string $value) "Set `mime_type` value"
* @method int getSize() "Get `size` value"
* @method $this setSize(int $value) "Set `size` value"
* @method string getSourceUrl() "Get `source_url` value"
* @method $this setSourceUrl(string $value) "Set `source_url` value"
* @method string getType() "Get `type` value"
* @method $this setType(string $value) "Set `type` value"
*/ */
class UploadFileResponse extends CommonFields class UploadFileResponse
{ {
use CommonFields;
/** /**
* JSON fields. Use setters and getters to work with this values. * @var string $createdAt
* Setters will return model instance, so you can construct any model like this: *
* ``` * @Type("string")
* $request = (new InfoRequest()) * @Accessor(getter="getCreatedAt",setter="setCreatedAt")
* ->setName("...") * @SkipWhenEmpty()
* ->setRoles([...]);
*```
* Model constructor can accept array as initial data. You can use
* this to initialize models:
* ```
* $request = new InfoRequest(["name" => "...", "roles" => [...]]);
* ```
*/ */
const JSON_PROPERTY_MAP = [ private $createdAt;
'created_at' => 'string',
'hash' => 'string', /**
'id' => 'string', * @var string $hash
'meta' => 'FileMeta', *
'mime_type' => 'string', * @Type("string")
'size' => 'int', * @Accessor(getter="getHash",setter="setHash")
'source_url' => 'string', * @SkipWhenEmpty()
'type' => 'string' */
]; private $hash;
/**
* @var string $id
*
* @Type("string")
* @Accessor(getter="getId",setter="setId")
* @SkipWhenEmpty()
*/
private $id;
/**
* @var FileMeta $meta
*
* @Type("FileMeta")
* @Accessor(getter="getMeta",setter="setMeta")
* @SkipWhenEmpty()
*/
private $meta;
/**
* @var string $mimeType
*
* @Type("string")
* @Accessor(getter="getMimeType",setter="setMimeType")
* @SkipWhenEmpty()
*/
private $mimeType;
/**
* @var int $size
*
* @Type("int")
* @Accessor(getter="getSize",setter="setSize")
* @SkipWhenEmpty()
*/
private $size;
/**
* @var string $time
*
* @Type("string")
* @Accessor(getter="getSourceUrl",setter="setSourceUrl")
* @SkipWhenEmpty()
*/
private $sourceUrl;
/**
* @var string $type
*
* @Type("string")
* @Accessor(getter="getType",setter="setType")
* @SkipWhenEmpty()
*/
private $type;
/**
* @return string
*/
public function getCreatedAt(): string
{
return $this->createdAt;
}
/**
* @param string $createdAt
*/
public function setCreatedAt(string $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return string
*/
public function getHash(): string
{
return $this->hash;
}
/**
* @param string $hash
*/
public function setHash(string $hash)
{
$this->hash = $hash;
}
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id)
{
$this->id = $id;
}
/**
* @return FileMeta
*/
public function getMeta(): FileMeta
{
return $this->meta;
}
/**
* @param FileMeta $meta
*/
public function setMeta(FileMeta $meta)
{
$this->meta = $meta;
}
/**
* @return string
*/
public function getMimeType(): string
{
return $this->mimeType;
}
/**
* @param string $mimeType
*/
public function setMimeType(string $mimeType)
{
$this->mimeType = $mimeType;
}
/**
* @return int
*/
public function getSize(): int
{
return $this->size;
}
/**
* @param int $size
*/
public function setSize(int $size)
{
$this->size = $size;
}
/**
* @return string
*/
public function getSourceUrl(): string
{
return $this->sourceUrl;
}
/**
* @param string $sourceUrl
*/
public function setSourceUrl(string $sourceUrl)
{
$this->sourceUrl = $sourceUrl;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type)
{
$this->type = $type;
}
} }

View File

@ -13,71 +13,334 @@
namespace RetailCrm\Common; namespace RetailCrm\Common;
use LazyJsonMapper\LazyJsonMapper; use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SkipWhenEmpty;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
* Register helper class. Fields: * RequestHelper class
*
* | Field name | Data type |
* |--------------------|-----------|
* | code | string |
* | integrationCode | string |
* | active | string |
* | name | string |
* | logo | string |
* | clientId | string |
* | baseUrl | string |
* | accountUrl | string |
* | actions | array |
* | availableCountries | array |
* | integrations | array |
* *
* @package RetailCrm\Common * @package RetailCrm\Common
* @author retailCRM <integration@retailcrm.ru> * @author retailCRM <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License * @license https://opensource.org/licenses/MIT MIT License
* @link http://help.retailcrm.pro/docs/Developers * @link http://help.retailcrm.pro/docs/Developers
*
* @method string getCode() "Get `code` value"
* @method $this setCode(string $value) "Set `code` value"
* @method string getIntegrationCode() "Get `integrationCode` value"
* @method $this setIntegrationCode(string $value) "Set `integrationCode` value"
* @method string getActive() "Get `active` value"
* @method $this setActive(string $value) "Set `active` value"
* @method string getName() "Get `name` value"
* @method $this setName(string $value) "Set `name` value"
* @method string getLogo() "Get `logo` value"
* @method $this setLogo(string $value) "Set `logo` value"
* @method string getClientId() "Get `clientId` value"
* @method $this setClientId(string $value) "Set `clientId` value"
* @method string getBaseUrl() "Get `baseUrl` value"
* @method $this setBaseUrl(string $value) "Set `baseUrl` value"
* @method string getAccountUrl() "Get `accountUrl` value"
* @method $this setAccountUrl(string $value) "Set `accountUrl` value"
* @method array getActions() "Get `actions` value"
* @method $this setActions(array $value) "Set `actions` value"
* @method array getAvailableCountries() "Get `availableCountries` value"
* @method $this setAvailableCountries(array $value) "Set `availableCountries` value"
* @method array getIntegrations() "Get `integrations` value"
* @method $this setIntegrations(array $value) "Set `integrations` value"
*/ */
class Register extends LazyJsonMapper class Register
{ {
/** /**
* @internal * @var string $code
*
* @Type("string")
* @Accessor(getter="getCode",setter="setCode")
*
* @Assert\NotBlank
*/ */
const JSON_PROPERTY_MAP = [ private $code;
'code' => 'string',
'integrationCode' => 'string', /**
'active' => 'string', * @var string $integrationCode
'name' => 'string', *
'logo' => 'string', * @Type("string")
'clientId' => 'string', * @Accessor(getter="getIntegrationCode",setter="setIntegrationCode")
'baseUrl' => 'string', *
'accountUrl' => 'string', * @Assert\NotBlank
'actions' => 'mixed', */
'availableCountries' => 'string[]', private $integrationCode;
'integrations' => 'mixed'
]; /**
* @var string $active
* @Type("string")
* @Accessor(getter="getActive",setter="setActive")
* @SkipWhenEmpty
*/
private $active;
/**
* @var string $name
*
* @Type("string")
* @Accessor(getter="getName",setter="setName")
* @SkipWhenEmpty
*/
private $name;
/**
* @var string $logo
*
* @Type("string")
* @Accessor(getter="getLogo",setter="setLogo")
* @SkipWhenEmpty
*
* @Assert\Url(
* message = "The logo url is not a valid url",
* protocols = {"http", "https"}
* )
*/
private $logo;
/**
* @var string $clientId
*
* @Type("string")
* @Accessor(getter="getClientId",setter="setClientId")
*
* @Assert\NotBlank
*/
private $clientId;
/**
* @var string $baseUrl
*
* @Type("string")
* @Accessor(getter="getBaseUrl",setter="setBaseUrl")
*
* @Assert\NotBlank
* @Assert\Url(
* message = "The baseUrl is not a valid url",
* protocols = {"http", "https"}
* )
*/
private $baseUrl;
/**
* @var string $accountUrl
*
* @Type("string")
* @Accessor(getter="getAccountUrl",setter="setAccountUrl")
*
* @Assert\NotBlank
* @Assert\Url(
* message = "The baseUrl is not a valid url",
* protocols = {"http", "https"}
* )
*/
private $accountUrl;
/**
* @var array $actions
*
* @Type("array")
* @Accessor(getter="getActions",setter="setActions")
*
* @Assert\NotBlank
*/
private $actions;
/**
* @var array $availableCountries
*
* @Type("array")
* @Accessor(getter="getAvailableCountries",setter="setAvailableCountries")
* @SkipWhenEmpty
*/
private $availableCountries;
/**
* @var array $integrations
*
* @Type("array")
* @Accessor(getter="getIntegrations",setter="setIntegrations")
*
* @Assert\NotBlank
*/
private $integrations;
/**
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode(string $code)
{
$this->code = $code;
}
/**
* @return string
*/
public function getIntegrationCode()
{
return $this->integrationCode;
}
/**
* @param string $integrationCode
*/
public function setIntegrationCode(string $integrationCode)
{
$this->integrationCode = $integrationCode;
}
/**
* @return string
*/
public function getActive()
{
return $this->active;
}
/**
* @param string $active
*/
public function setActive(string $active)
{
$this->active = $active;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getLogo()
{
return $this->logo;
}
/**
* @param string $logo
*/
public function setLogo(string $logo)
{
$this->logo = $logo;
}
/**
* @return string
*/
public function getClientId()
{
return $this->clientId;
}
/**
* @param string $clientId
*/
public function setClientId(string $clientId)
{
$this->clientId = $clientId;
}
/**
* @return string
*/
public function getBaseUrl()
{
return $this->baseUrl;
}
/**
* @param string $baseUrl
*/
public function setBaseUrl(string $baseUrl)
{
$this->baseUrl = $baseUrl;
}
/**
* @return string
*/
public function getAccountUrl()
{
return $this->accountUrl;
}
/**
* @param string $accountUrl
*/
public function setAccountUrl(string $accountUrl)
{
$this->accountUrl = $accountUrl;
}
/**
* @return array
*/
public function getActions()
{
return $this->actions;
}
/**
* @param array $actions
*/
public function setActions(array $actions)
{
$this->actions = $actions;
}
/**
* @return array
*/
public function getAvailableCountries()
{
return $this->availableCountries;
}
/**
* @param array $availableCountries
*/
public function setAvailableCountries(array $availableCountries)
{
$this->availableCountries = $availableCountries;
}
/**
* @return array
*/
public function getIntegrations()
{
return $this->integrations;
}
/**
* @param array $integrations
*/
public function setIntegrations(array $integrations)
{
$this->integrations = $integrations;
}
/**
* Get configuration as JSON
*
* @return array|string
*/
public function getJsonConfiguration()
{
return Serializer::serialize($this);
}
/**
* Get configuration as array
*
* @return array|string
*/
public function getArrayConfiguration()
{
return Serializer::serialize($this, Serializer::S_ARRAY);
}
} }

View File

@ -13,6 +13,10 @@
namespace RetailCrm\Common; namespace RetailCrm\Common;
use JMS\Serializer\DeserializationContext;
use JMS\Serializer\SerializationContext;
use JMS\Serializer\SerializerBuilder;
/** /**
* PHP version 7.0 * PHP version 7.0
* *
@ -25,15 +29,8 @@ namespace RetailCrm\Common;
*/ */
class Serializer class Serializer
{ {
/** const S_ARRAY = 'array';
* Serialization flag: serialize object to PHP Array const S_JSON = 'json';
*/
const S_ARRAY = 0;
/**
* Serialization flag: serialize object to JSON string
*/
const S_JSON = 1;
/** /**
* Serialize given object to JSON or Array * Serialize given object to JSON or Array
@ -46,17 +43,64 @@ class Serializer
public static function serialize($request, $serialize = self::S_JSON) public static function serialize($request, $serialize = self::S_JSON)
{ {
$serialized = null; $serialized = null;
$serializer = SerializerBuilder::create()->build();
$context = self::getContext();
switch ($serialize) { switch ($serialize) {
case self::S_ARRAY: case self::S_ARRAY:
$serialized = $request->asArray(); $serialized = $serializer->toArray($request, $context);
break; break;
case self::S_JSON: case self::S_JSON:
default: default:
$serialized = $request->asJson(); $serialized = $serializer->serialize($request, $serialize, $context);
break; break;
} }
return $serialized; return $serialized;
} }
/**
* Deserialize given array or JSON to object
*
* @param $data
* @param $entityType
* @param string $from
*
* @return array|object|null
*/
public static function deserialize($data, $entityType, $from = self::S_JSON)
{
$deserialized = null;
$serializer = SerializerBuilder::create()->build();
$context = self::getContext(true);
switch ($from) {
case self::S_ARRAY:
$deserialized = $serializer->fromArray(array_filter($data), $entityType, $context);
break;
case self::S_JSON:
$deserialized = $serializer->deserialize($data, $entityType, $from, $context);
break;
}
return $deserialized;
}
/**
* @param bool $deserialization (default: false)
*
* @return DeserializationContext|SerializationContext
*/
private static function getContext(bool $deserialization = false)
{
if ($deserialization) {
$context = new DeserializationContext();
} else {
$context = new SerializationContext();
}
$context->setSerializeNull(false);
return $context;
}
} }