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

feat(xdsl.templatemodem): add template modem #156

Merged
merged 7 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions dist/ovh-api-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -25606,6 +25606,87 @@ angular.module("ovh-api-services").service("OvhApiXdslTasksCurrent", ["$injector
};
}]);

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

var cache = $cacheFactory("OvhApiXdslTemplateModem");

return {
v6: function () {
return $injector.get("OvhApiXdslTemplateModemV6");
},
resetCache: function () {
cache.removeAll();
},
cache: cache
};
}]);

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

var cache = $cacheFactory("OvhApiXdslTemplateModemV6");
var queryCache = $cacheFactory("OvhApiXdslTemplateModemV6Query");

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

var templateModemResource = $resource("/xdsl/templateModem", {
xdslId: "@xdslId",
name: "@name",
serviceName: "@serviceName"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
cache: cache
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
url: "/xdsl/templateModem/:name",
cache: cache
},
post: {
method: "POST",
interceptor: interceptor
},
getTemplate: {
method: "GET",
url: "/xdsl/templateModem/:name"
},
updateTemplate: {
method: "PUT",
url: "/xdsl/templateModem/:name",
interceptor: interceptor
},
deleteTemplate: {
method: "DELETE",
url: "/xdsl/templateModem/:name",
interceptor: interceptor
}
});

templateModemResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return templateModemResource;
}]);

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

Expand Down Expand Up @@ -25652,6 +25733,9 @@ angular.module("ovh-api-services").service("OvhApiXdsl", ["$injector", "$cacheFa
Modem: function () {
return $injector.get("OvhApiXdslModem");
},
TemplateModem: function () {
return $injector.get("OvhApiXdslTemplateModem");
},
resetCache: cache.removeAll,
cache: cache
};
Expand Down Expand Up @@ -25738,6 +25822,10 @@ angular.module("ovh-api-services").service("OvhApiXdslV6", ["$resource", "OvhApi
getTask: {
method: "GET",
url: "/xdsl/:xdslId/tasks/:taskId"
},
applyTemplate: {
method: "POST",
url: "/xdsl/:xdslId/applyTemplateToModem"
}
}
);
Expand Down
4 changes: 2 additions & 2 deletions dist/ovh-api-services.min.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/xdsl/templateModem/xdsl-template-modem.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
angular.module("ovh-api-services").service("OvhApiXdslTemplateModem", function ($injector, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiXdslTemplateModem");

return {
v6: function () {
return $injector.get("OvhApiXdslTemplateModemV6");
},
resetCache: function () {
cache.removeAll();
},
cache: cache
};
});
64 changes: 64 additions & 0 deletions src/xdsl/templateModem/xdsl-template-modem.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
angular.module("ovh-api-services").service("OvhApiXdslTemplateModemV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiXdslTemplateModemV6");
var queryCache = $cacheFactory("OvhApiXdslTemplateModemV6Query");

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

var templateModemResource = $resource("/xdsl/templateModem", {
xdslId: "@xdslId",
name: "@name",
serviceName: "@serviceName"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
cache: cache
},
getBatch: {
method: "GET",
isArray: true,
headers: {
"X-Ovh-Batch": ","
},
url: "/xdsl/templateModem/:name",
cache: cache
},
post: {
method: "POST",
interceptor: interceptor
},
getTemplate: {
method: "GET",
url: "/xdsl/templateModem/:name"
},
updateTemplate: {
method: "PUT",
url: "/xdsl/templateModem/:name",
interceptor: interceptor
},
deleteTemplate: {
method: "DELETE",
url: "/xdsl/templateModem/:name",
interceptor: interceptor
}
});

templateModemResource.resetAllCache = function () {
cache.removeAll();
queryCache.removeAll();
};

return templateModemResource;
});
3 changes: 3 additions & 0 deletions src/xdsl/xdsl.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ angular.module("ovh-api-services").service("OvhApiXdsl", function ($injector, $c
Modem: function () {
return $injector.get("OvhApiXdslModem");
},
TemplateModem: function () {
return $injector.get("OvhApiXdslTemplateModem");
},
resetCache: cache.removeAll,
cache: cache
};
Expand Down
4 changes: 4 additions & 0 deletions src/xdsl/xdsl.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ angular.module("ovh-api-services").service("OvhApiXdslV6", function ($resource,
getTask: {
method: "GET",
url: "/xdsl/:xdslId/tasks/:taskId"
},
applyTemplate: {
method: "POST",
url: "/xdsl/:xdslId/applyTemplateToModem"
}
}
);
Expand Down