From 31da74f98374b348f47651fb34335d17b407a87f Mon Sep 17 00:00:00 2001 From: radireddy Date: Tue, 10 Dec 2019 13:28:51 +0530 Subject: [PATCH] feat(hosting.web): added hosting email option end points (#267) --- .../hosting-web-email-option.service.js | 5 +++ .../hosting-web-email-option.v6.service.js | 34 +++++++++++++++++++ src/api/hosting/web/web.service.js | 3 ++ 3 files changed, 42 insertions(+) create mode 100644 src/api/hosting/web/emailOption/hosting-web-email-option.service.js create mode 100644 src/api/hosting/web/emailOption/hosting-web-email-option.v6.service.js diff --git a/src/api/hosting/web/emailOption/hosting-web-email-option.service.js b/src/api/hosting/web/emailOption/hosting-web-email-option.service.js new file mode 100644 index 00000000..7dd36eb2 --- /dev/null +++ b/src/api/hosting/web/emailOption/hosting-web-email-option.service.js @@ -0,0 +1,5 @@ +angular.module('ovh-api-services').service('OvhApiHostingWebEmailOption', ($injector) => ({ + v6() { + return $injector.get('OvhApiHostingWebEmailOptionV6'); + }, +})); diff --git a/src/api/hosting/web/emailOption/hosting-web-email-option.v6.service.js b/src/api/hosting/web/emailOption/hosting-web-email-option.v6.service.js new file mode 100644 index 00000000..80ac351d --- /dev/null +++ b/src/api/hosting/web/emailOption/hosting-web-email-option.v6.service.js @@ -0,0 +1,34 @@ +angular.module('ovh-api-services').service('OvhApiHostingWebEmailOptionV6', ($resource, $cacheFactory) => { + const cache = $cacheFactory('OvhApiHostingWebEmailOptionv6Cache'); + const queryCache = $cacheFactory('OvhApiHostingWebEmailOptionv6CacheQuery'); + + const resource = $resource('/hosting/web/:serviceName/emailOption/:id', { + serviceName: '@serviceName', + id: '@id', + }, { + query: { + method: 'GET', + cache: queryCache, + isArray: true, + }, + get: { + method: 'GET', + cache, + }, + serviceInfo: { + method: 'GET', + url: '/hosting/web/:serviceName/emailOption/:id/serviceInfos', + cache, + } + }); + + resource.resetCache = function () { + cache.removeAll(); + }; + + resource.resetQueryCache = function () { + queryCache.removeAll(); + }; + + return resource; +}); diff --git a/src/api/hosting/web/web.service.js b/src/api/hosting/web/web.service.js index 7e3ec11f..8703bc25 100644 --- a/src/api/hosting/web/web.service.js +++ b/src/api/hosting/web/web.service.js @@ -8,6 +8,9 @@ angular.module('ovh-api-services').service('OvhApiHostingWeb', ($injector) => ({ Ssl() { return $injector.get('OvhApiHostingWebSsl'); }, + EmailOption() { + return $injector.get('OvhApiHostingWebEmailOption'); + }, v6() { return $injector.get('OvhApiHostingWebV6'); },