Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
feat(xdsl): add email pro
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Bourgois committed Jul 11, 2018
1 parent b558819 commit 2fa5c60
Show file tree
Hide file tree
Showing 9 changed files with 308 additions and 8 deletions.
152 changes: 152 additions & 0 deletions dist/ovh-api-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -10365,6 +10365,76 @@ angular.module("ovh-api-services").service("OvhApiPackXdslDomainActivationV6", [
});
}]);

angular.module("ovh-api-services").service("OvhApiPackXdslEmailPro", ["$injector", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiPackXdslEmailProV6");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiPackXdslEmailProV6", ["$resource", "$cacheFactory", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiPackXdslEmailProV6");
var queryCache = $cacheFactory("OvhApiPackXdslEmailProV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var emailPro = $resource("/pack/xdsl/:packName/emailPro/services", {
packName: "@packName"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
save: {
method: "POST",
interceptor: interceptor
},
getDomains: {
method: "GET",
url: "/pack/xdsl/:packName/emailPro/options/domains",
isArray: true,
cache: cache
},
isEmailAvailable: {
method: "GET",
url: "/pack/xdsl/:packName/emailPro/options/isEmailAvailable",
transformResponse: function (data, headersGetter, status) {
if (status !== 200) {
return data;
}
return { available: _.trim(data).toUpperCase() === "TRUE" };
}
}
});

emailPro.resetCache = function () {
cache.removeAll();
};

emailPro.resetQueryCache = function () {
queryCache.removeAll();
};

emailPro.resetAllCache = function () {
emailPro.resetCache();
emailPro.resetQueryCache();
};

return emailPro;
}]);

angular.module("ovh-api-services").service("OvhApiPackXdslExchangeAccountAapi", ["$resource", "OvhApiPackXdslExchangeAccount", function ($resource, OvhApiPackXdslExchangeAccount) {
"use strict";

Expand Down Expand Up @@ -10749,6 +10819,9 @@ angular.module("ovh-api-services").service("OvhApiPackXdsl", ["$injector", "$cac
DomainActivation: function () {
return $injector.get("OvhApiPackXdslDomainActivation");
},
EmailPro: function () {
return $injector.get("OvhApiPackXdslEmailPro");
},
ExchangeAccount: function () {
return $injector.get("OvhApiPackXdslExchangeAccount");
},
Expand Down Expand Up @@ -20523,6 +20596,82 @@ angular.module("ovh-api-services").service("OvhApiXdslEligibilityV6", ["$resourc
});
}]);

angular.module("ovh-api-services").service("OvhApiXdslEmailPro", ["$injector", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiXdslEmailProV6");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiXdslEmailProV6", ["$resource", "$cacheFactory", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiXdslEmailProV6");
var queryCache = $cacheFactory("OvhApiXdslEmailProV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var emailPro = $resource("/xdsl/email/pro/:email", {
email: "@email"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
interceptor: interceptor
},
save: {
method: "POST",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
},
changePassword: {
method: "POST",
interceptor: interceptor,
url: "/xdsl/email/pro/:email/changePassword"
}
}
);

emailPro.resetCache = function () {
cache.removeAll();
};

emailPro.resetQueryCache = function () {
queryCache.removeAll();
};

emailPro.resetAllCache = function () {
emailPro.resetCache();
emailPro.resetQueryCache();
};

return emailPro;
}]);

angular.module("ovh-api-services").service("OvhApiXdslEmail", ["$injector", function ($injector) {
"use strict";
return {
Pro: function () {
return $injector.get("OvhApiXdslEmailPro");
}
};
}]);

angular.module("ovh-api-services").service("OvhApiXdslIpsAapi", ["$resource", "OvhApiXdslIps", function ($resource, OvhApiXdslIps) {
"use strict";

Expand Down Expand Up @@ -21484,6 +21633,9 @@ angular.module("ovh-api-services").service("OvhApiXdsl", ["$injector", "$cacheFa
v7: function () {
return $injector.get("OvhApiXdslV7");
},
Email: function () {
return $injector.get("OvhApiXdslEmail");
},
Lines: function () {
return $injector.get("OvhApiXdslLines");
},
Expand Down
17 changes: 9 additions & 8 deletions dist/ovh-api-services.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/pack/xdsl/emailPro/pack-xdsl-email-pro.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
angular.module("ovh-api-services").service("OvhApiPackXdslEmailPro", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiPackXdslEmailProV6");
}
};
});
59 changes: 59 additions & 0 deletions src/pack/xdsl/emailPro/pack-xdsl-email-pro.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
angular.module("ovh-api-services").service("OvhApiPackXdslEmailProV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiPackXdslEmailProV6");
var queryCache = $cacheFactory("OvhApiPackXdslEmailProV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var emailPro = $resource("/pack/xdsl/:packName/emailPro/services", {
packName: "@packName"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
save: {
method: "POST",
interceptor: interceptor
},
getDomains: {
method: "GET",
url: "/pack/xdsl/:packName/emailPro/options/domains",
isArray: true,
cache: cache
},
isEmailAvailable: {
method: "GET",
url: "/pack/xdsl/:packName/emailPro/options/isEmailAvailable",
transformResponse: function (data, headersGetter, status) {
if (status !== 200) {
return data;
}
return { available: _.trim(data).toUpperCase() === "TRUE" };
}
}
});

emailPro.resetCache = function () {
cache.removeAll();
};

emailPro.resetQueryCache = function () {
queryCache.removeAll();
};

emailPro.resetAllCache = function () {
emailPro.resetCache();
emailPro.resetQueryCache();
};

return emailPro;
});
3 changes: 3 additions & 0 deletions src/pack/xdsl/pack-xdsl.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ angular.module("ovh-api-services").service("OvhApiPackXdsl", function ($injector
DomainActivation: function () {
return $injector.get("OvhApiPackXdslDomainActivation");
},
EmailPro: function () {
return $injector.get("OvhApiPackXdslEmailPro");
},
ExchangeAccount: function () {
return $injector.get("OvhApiPackXdslExchangeAccount");
},
Expand Down
8 changes: 8 additions & 0 deletions src/xdsl/email/pro/xdsl-email-pro.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiXdslEmailPro", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiXdslEmailProV6");
}
};
});
57 changes: 57 additions & 0 deletions src/xdsl/email/pro/xdsl-email-pro.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
angular.module("ovh-api-services").service("OvhApiXdslEmailProV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiXdslEmailProV6");
var queryCache = $cacheFactory("OvhApiXdslEmailProV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var emailPro = $resource("/xdsl/email/pro/:email", {
email: "@email"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
interceptor: interceptor
},
save: {
method: "POST",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
},
changePassword: {
method: "POST",
interceptor: interceptor,
url: "/xdsl/email/pro/:email/changePassword"
}
}
);

emailPro.resetCache = function () {
cache.removeAll();
};

emailPro.resetQueryCache = function () {
queryCache.removeAll();
};

emailPro.resetAllCache = function () {
emailPro.resetCache();
emailPro.resetQueryCache();
};

return emailPro;
});
8 changes: 8 additions & 0 deletions src/xdsl/email/xdsl-email.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiXdslEmail", function ($injector) {
"use strict";
return {
Pro: function () {
return $injector.get("OvhApiXdslEmailPro");
}
};
});
3 changes: 3 additions & 0 deletions src/xdsl/xdsl.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ angular.module("ovh-api-services").service("OvhApiXdsl", function ($injector, $c
v7: function () {
return $injector.get("OvhApiXdslV7");
},
Email: function () {
return $injector.get("OvhApiXdslEmail");
},
Lines: function () {
return $injector.get("OvhApiXdslLines");
},
Expand Down

0 comments on commit 2fa5c60

Please sign in to comment.