This repository has been archived by the owner on May 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Open-MBEE/openapi
openapi generated client
- Loading branch information
Showing
44 changed files
with
2,351 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Created by https://www.gitignore.io/api/matlab | ||
|
||
### Matlab ### | ||
##--------------------------------------------------- | ||
## Remove autosaves generated by the Matlab editor | ||
## We have git for backups! | ||
##--------------------------------------------------- | ||
|
||
# Windows default autosave extension | ||
*.asv | ||
|
||
# OSX / *nix default autosave extension | ||
*.m~ | ||
|
||
# Compiled MEX binaries (all platforms) | ||
*.mex* | ||
|
||
# Simulink Code Generation | ||
slprj/ | ||
|
||
# Session info | ||
octave-workspace | ||
|
||
# Simulink autosave extension | ||
*.autosave | ||
|
||
|
||
# End of https://www.gitignore.io/api/matlab | ||
|
||
|
||
# Created by https://www.gitignore.io/api/macos | ||
|
||
### macOS ### | ||
*.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
|
||
# End of https://www.gitignore.io/api/macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
%----------------------------------------------------------- | ||
%Download passcode.m from Supplementary Functions package | ||
%----------------------------------------------------------- | ||
|
||
function Login(username,basePath) | ||
|
||
%----------------------------------------------------------- | ||
%Description: Log into server | ||
% | ||
%input Args: | ||
% basePath(str) = https://mms.org | ||
% username(str) = JPL username | ||
% passcode = JPL password (type in passcode text box) | ||
%----------------------------------------------------------- | ||
|
||
LoginRequest(); | ||
Matlab_MMS_client.setBasePath(basePath) | ||
out.username = username; | ||
out.password = passcode(); | ||
%Matlab_MMS_client.setBasicAuth(out.username, out.password); | ||
tick = TicketApi.post_ticket(out); | ||
Matlab_MMS_client.setTicketAuth(tick.data.ticket); | ||
|
||
clear out | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function UpdateDocumentation(username, basePath, project, ref, id1, id2, content1, content2, desiredFields) | ||
%------------------------------------------------------ | ||
%Description: Update documentation of a presentation | ||
% element. | ||
% | ||
%input Args | ||
%username(str): JPL username | ||
%password(str): JPL password (enter in text box) | ||
%basePath(str): https://mms.org | ||
%project(str): project ID | ||
%ref(str): ref ID | ||
%id(str): element ID | ||
%content(str): documentation | ||
%desiredFields(str array): fields to update ["id" | ||
%"documentation"] | ||
%------------------------------------------------------ | ||
|
||
Login(username, basePath); | ||
|
||
json1 = ElementApi.get_element(project, ref, id1); | ||
json2 = ElementApi.get_element(project, ref, id2); | ||
|
||
out1 = removeFields(json1, desiredFields); | ||
out2 = removeFields(json2, desiredFields); | ||
|
||
out1 = setfield(out1,'documentation', content1); | ||
out2 = setfield(out2,'documentation', content2); | ||
|
||
posted = ElementApi.post_elements(project, ref, [out1,out2]); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function UpdateName(username, basePath, project, ref, id1, id2, newName1, newName2, desiredFields) | ||
|
||
%------------------------------------------------------ | ||
%Description: Update name of an element | ||
% | ||
%input Args | ||
%username(str): JPL username | ||
%password(str): JPL password (enter in text box) | ||
%basePath(str): mms.org | ||
%project(str): project ID | ||
%ref(str): ref ID | ||
%id(str): element ID | ||
%content(str): documentation | ||
%desiredFields(str array): fields to update["id" | ||
%"name"] | ||
%------------------------------------------------------ | ||
Login(username, basePath); | ||
|
||
json1 = ElementApi.get_element(project, ref, id1); | ||
json2 = ElementApi.get_element(project, ref, id2); | ||
|
||
out1 = removeFields(json1, desiredFields); | ||
out2 = removeFields(json2, desiredFields); | ||
|
||
out1 = setfield(out1,'name', newName1); | ||
out2 = setfield(out2,'name', newName2); | ||
|
||
posted = ElementApi.post_elements(project, ref, [out1,out2]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function postImagefromURL(username, basePath, project, ref, name1, name2, picUrl1,picUrl2,desiredFields) | ||
|
||
Login(username, basePath); | ||
|
||
pic1 = strcat('<img src="',picUrl1,'" />'); | ||
pic2 = strcat('<img src="',picUrl2,'" />'); | ||
|
||
s = struct('id','_hidden_MMS_1529082050667_32fffb1e-e0e4-40da-9e74-2f586f711818_pei','type','InstanceSpecification','name',name1,'documentation', pic1); | ||
t = struct('id','_hidden_MMS_1529358324856_8442b90f-4e70-4359-be1e-ff6eef6e2259_pei','type','InstanceSpecification','name',name2,'documentation', pic2); | ||
|
||
posted = ElementApi.post_elements(project,ref,[s,t]); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function out = removeFields(structure, desiredFields) | ||
|
||
fields = fieldnames(structure.elements); | ||
out = struct(); | ||
|
||
for i = 1:length(desiredFields) | ||
for j = 1:length(fields) | ||
if strcmp(desiredFields(i), string(fields(j))) | ||
out = setfield(out,desiredFields(i), structure.elements.(desiredFields(i))); | ||
end | ||
end | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.