blueprint_ruby_client 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/blueprint_ruby_client-0.5.1.gem +0 -0
- data/config.json +1 -1
- data/docs/Asset.md +1 -0
- data/docs/AssetRelationships.md +8 -0
- data/docs/AssetsApi.md +65 -0
- data/docs/HierarchyApi.md +10 -6
- data/git_push.sh +52 -0
- data/lib/blueprint_ruby_client/api/assets_api.rb +110 -0
- data/lib/blueprint_ruby_client/api/hierarchy_api.rb +24 -6
- data/lib/blueprint_ruby_client/models/asset.rb +29 -4
- data/lib/blueprint_ruby_client/models/asset_relationships.rb +207 -0
- data/lib/blueprint_ruby_client/version.rb +1 -1
- data/lib/blueprint_ruby_client.rb +1 -0
- data/spec/api/assets_api_spec.rb +21 -0
- data/spec/api/hierarchy_api_spec.rb +5 -3
- data/spec/models/asset_relationships_spec.rb +46 -0
- data/spec/models/asset_spec.rb +10 -0
- data/swagger-codegen-cli.jar +0 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fe7bdb24acb8e8a338f7f0a477fd0b987b100ba
|
4
|
+
data.tar.gz: dfd2b5ee16931be16d7884ddb5ed1c25b91df76e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483c43af5f79233afa97f7aa4a599a0e265d275ba8f5a7d164190b924556d21d973a47d0b378f7b39972ac32c12089798921cdc665d40d81b1f366e263359372
|
7
|
+
data.tar.gz: 0f6570c1316b001e36613dc42799dda49b1bb2a272921650b128deec785d3afe2192d3701a267a95db1bdd6a7b4988f27085b3da954590197fe62b51273745ff
|
data/README.md
CHANGED
@@ -7,8 +7,8 @@ This is the API documentation for [Blueprint](https://github.com/talis/blueprint
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
9
|
- API version: 1.0.0
|
10
|
-
- Package version: 0.5.
|
11
|
-
- Build date:
|
10
|
+
- Package version: 0.5.2
|
11
|
+
- Build date: 2017-01-06T16:19:57.389-05:00
|
12
12
|
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
13
13
|
|
14
14
|
## Installation
|
@@ -34,15 +34,15 @@ gem build blueprint_ruby_client.gemspec
|
|
34
34
|
Then either install the gem locally:
|
35
35
|
|
36
36
|
```shell
|
37
|
-
gem install ./blueprint_ruby_client-0.5.
|
37
|
+
gem install ./blueprint_ruby_client-0.5.2.gem
|
38
38
|
```
|
39
|
-
(for development, run `gem install --dev ./blueprint_ruby_client-0.5.
|
39
|
+
(for development, run `gem install --dev ./blueprint_ruby_client-0.5.2.gem` to install the development dependencies)
|
40
40
|
|
41
41
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
42
42
|
|
43
43
|
Finally add this to the Gemfile:
|
44
44
|
|
45
|
-
gem 'blueprint_ruby_client', '~> 0.5.
|
45
|
+
gem 'blueprint_ruby_client', '~> 0.5.2'
|
46
46
|
|
47
47
|
### Install from Git
|
48
48
|
|
@@ -103,6 +103,7 @@ Class | Method | HTTP request | Description
|
|
103
103
|
*BlueprintClient::AssetsApi* | [**get_assets_in_node**](docs/AssetsApi.md#get_assets_in_node) | **GET** /{namespace}/nodes/{type}/{id}/assets |
|
104
104
|
*BlueprintClient::AssetsApi* | [**remove_asset_from_node**](docs/AssetsApi.md#remove_asset_from_node) | **DELETE** /{namespace}/nodes/{type}/{id}/assets/{assetType}/{assetId} |
|
105
105
|
*BlueprintClient::AssetsApi* | [**replace_asset**](docs/AssetsApi.md#replace_asset) | **PUT** /{namespace}/assets/{assetType}/{assetId} | Replaces the Asset with the data sent in the body
|
106
|
+
*BlueprintClient::AssetsApi* | [**search_assets**](docs/AssetsApi.md#search_assets) | **GET** /{namespace}/assets | Search assets
|
106
107
|
*BlueprintClient::HierarchyApi* | [**add_node**](docs/HierarchyApi.md#add_node) | **POST** /{namespaceIncGlobal}/nodes |
|
107
108
|
*BlueprintClient::HierarchyApi* | [**bulk_upload**](docs/HierarchyApi.md#bulk_upload) | **POST** /{namespace}/nodes.csv |
|
108
109
|
*BlueprintClient::HierarchyApi* | [**delete_node**](docs/HierarchyApi.md#delete_node) | **DELETE** /{namespace}/nodes/{type}/{id} |
|
@@ -129,6 +130,7 @@ Class | Method | HTTP request | Description
|
|
129
130
|
- [BlueprintClient::Asset](docs/Asset.md)
|
130
131
|
- [BlueprintClient::AssetBody](docs/AssetBody.md)
|
131
132
|
- [BlueprintClient::AssetRelationship](docs/AssetRelationship.md)
|
133
|
+
- [BlueprintClient::AssetRelationships](docs/AssetRelationships.md)
|
132
134
|
- [BlueprintClient::AssetResultSet](docs/AssetResultSet.md)
|
133
135
|
- [BlueprintClient::Error](docs/Error.md)
|
134
136
|
- [BlueprintClient::Errors](docs/Errors.md)
|
Binary file
|
data/config.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"gemName": "blueprint_ruby_client",
|
3
3
|
"moduleName": "BlueprintClient",
|
4
|
-
"gemVersion": "0.5.
|
4
|
+
"gemVersion": "0.5.2",
|
5
5
|
"gemLicense": "Copyright Talis Education Ltd",
|
6
6
|
"gemHomepage": "https://github.com/talis/blueprint_rb",
|
7
7
|
"gemSummary": "A ruby API wrapper for Blueprint",
|
data/docs/Asset.md
CHANGED
data/docs/AssetsApi.md
CHANGED
@@ -10,6 +10,7 @@ Method | HTTP request | Description
|
|
10
10
|
[**get_assets_in_node**](AssetsApi.md#get_assets_in_node) | **GET** /{namespace}/nodes/{type}/{id}/assets |
|
11
11
|
[**remove_asset_from_node**](AssetsApi.md#remove_asset_from_node) | **DELETE** /{namespace}/nodes/{type}/{id}/assets/{assetType}/{assetId} |
|
12
12
|
[**replace_asset**](AssetsApi.md#replace_asset) | **PUT** /{namespace}/assets/{assetType}/{assetId} | Replaces the Asset with the data sent in the body
|
13
|
+
[**search_assets**](AssetsApi.md#search_assets) | **GET** /{namespace}/assets | Search assets
|
13
14
|
|
14
15
|
|
15
16
|
# **add_asset_to_node**
|
@@ -378,3 +379,67 @@ Name | Type | Description | Notes
|
|
378
379
|
|
379
380
|
|
380
381
|
|
382
|
+
# **search_assets**
|
383
|
+
> AssetResultSet search_assets(namespace, , opts)
|
384
|
+
|
385
|
+
Search assets
|
386
|
+
|
387
|
+
This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.\nThe include parameter can only be set to `nodes`\n\n###### Find all assets in namespace abc\n`/1/abc/assets`\n\n###### Find all lists for abc:\n`/1/abc/assets?filter[assetType]=lists`\n\n###### Find all assets that are related to a given node of DEP101:\n`/1/abc/assets?filter[node]=departments%2Fdep101`\n\n###### Find all assets that are related to both node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101&filter[node]=departments%2Fdep102`\n\n###### Find all assets that are related to either node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101,departments%2Fdep102`\n
|
388
|
+
|
389
|
+
### Example
|
390
|
+
```ruby
|
391
|
+
# load the gem
|
392
|
+
require 'blueprint_ruby_client'
|
393
|
+
# setup authorization
|
394
|
+
BlueprintClient.configure do |config|
|
395
|
+
# Configure OAuth2 access token for authorization: oauth2
|
396
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
397
|
+
end
|
398
|
+
|
399
|
+
api_instance = BlueprintClient::AssetsApi.new
|
400
|
+
|
401
|
+
namespace = "namespace_example" # String | identifier namespacing the blueprint.
|
402
|
+
|
403
|
+
opts = {
|
404
|
+
offset: 3.4, # Float | index to start result set from
|
405
|
+
limit: 3.4 # Float | number of records to return
|
406
|
+
include: ["include_example"] # Array<String> | comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
407
|
+
filter_node: ["filter_node_example"], # Array<String> | limit to assets that are related to a node matching type/code
|
408
|
+
filter_asset_type: ["filter_asset_type_example"], # Array<String> | type of asset to return
|
409
|
+
}
|
410
|
+
|
411
|
+
begin
|
412
|
+
#Search assets
|
413
|
+
result = api_instance.search_assets(namespace, , opts)
|
414
|
+
p result
|
415
|
+
rescue BlueprintClient::ApiError => e
|
416
|
+
puts "Exception when calling AssetsApi->search_assets: #{e}"
|
417
|
+
end
|
418
|
+
```
|
419
|
+
|
420
|
+
### Parameters
|
421
|
+
|
422
|
+
Name | Type | Description | Notes
|
423
|
+
------------- | ------------- | ------------- | -------------
|
424
|
+
**namespace** | **String**| identifier namespacing the blueprint. |
|
425
|
+
**offset** | [**Float**](.md)| index to start result set from | [optional]
|
426
|
+
**limit** | [**Float**](.md)| number of records to return | [optional]
|
427
|
+
**include** | [**Array<String>**](String.md)| comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets | [optional]
|
428
|
+
**filter_node** | [**Array<String>**](String.md)| limit to assets that are related to a node matching type/code | [optional]
|
429
|
+
**filter_asset_type** | [**Array<String>**](String.md)| type of asset to return | [optional]
|
430
|
+
|
431
|
+
### Return type
|
432
|
+
|
433
|
+
[**AssetResultSet**](AssetResultSet.md)
|
434
|
+
|
435
|
+
### Authorization
|
436
|
+
|
437
|
+
[oauth2](../README.md#oauth2)
|
438
|
+
|
439
|
+
### HTTP request headers
|
440
|
+
|
441
|
+
- **Content-Type**: application/json
|
442
|
+
- **Accept**: application/vnd.api+json
|
443
|
+
|
444
|
+
|
445
|
+
|
data/docs/HierarchyApi.md
CHANGED
@@ -446,7 +446,7 @@ id = "id_example" # String | id identifying a domain model
|
|
446
446
|
type = "type_example" # String | subtype of Node, e.g. 'modules', 'departments', etc.
|
447
447
|
|
448
448
|
opts = {
|
449
|
-
include: ["include_example"] # Array<String> | comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
449
|
+
include: ["include_example"] # Array<String> | comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
450
450
|
}
|
451
451
|
|
452
452
|
begin
|
@@ -465,7 +465,7 @@ Name | Type | Description | Notes
|
|
465
465
|
**namespace** | **String**| identifier namespacing the blueprint. |
|
466
466
|
**id** | **String**| id identifying a domain model |
|
467
467
|
**type** | **String**| subtype of Node, e.g. 'modules', 'departments', etc. |
|
468
|
-
**include** | [**Array<String>**](String.md)| comma separated list of elements to hydrate. Can include children, parents, and/or assets | [optional]
|
468
|
+
**include** | [**Array<String>**](String.md)| comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets | [optional]
|
469
469
|
|
470
470
|
### Return type
|
471
471
|
|
@@ -612,7 +612,7 @@ Name | Type | Description | Notes
|
|
612
612
|
|
613
613
|
Search nodes
|
614
614
|
|
615
|
-
This endpoint is a really flexible way to ask questions about the hierarchy
|
615
|
+
This endpoint is a really flexible way to ask questions about the hierarchy.\nThe includes parameter can be set to either parents, children, assets.\n\nExamples:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Modules`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101`\n\n###### Find all nodes that are descendants of DEP101 or DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101,departments%2Fdep102`\n\n###### Find all nodes that are descendants of DEP101 and DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101&filter[descendant]=departments%2Fdep102``\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=modules%2Fabf203&filter[nodeType]=Departments` # <= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Modules&filter[ancestor]=departments%2FDEP101&filter[hasAssets]=true&filter[assetType]=Lists`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[assetType]=Lists`\n\n###### Find all nodes of type modules during 2015 that have no assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[from]=20150101&filter[to]=20151231`\n\n###### Find all nodes of type modules with assets which are also related to DEP101.\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=true&filter[assetNode]=departments%2Fdep101`\n
|
616
616
|
|
617
617
|
### Example
|
618
618
|
```ruby
|
@@ -631,7 +631,8 @@ namespace_inc_global = "namespace_inc_global_example" # String | identifier name
|
|
631
631
|
opts = {
|
632
632
|
offset: 3.4, # Float | index to start result set from
|
633
633
|
limit: 3.4 # Float | number of records to return
|
634
|
-
include: ["include_example"] # Array<String> | comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
634
|
+
include: ["include_example"] # Array<String> | comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
635
|
+
filter_asset: ["filter_asset_example"], # Array<String> | limit to nodes that have an asset matching type/code
|
635
636
|
filter_node_type: ["filter_node_type_example"], # Array<String> | type of nodes to return
|
636
637
|
filter_child: ["filter_child_example"], # Array<String> | limit to nodes with children matching type/code
|
637
638
|
filter_parent: ["filter_parent_example"], # Array<String> | limit to nodes with parent matching type/code
|
@@ -645,7 +646,8 @@ opts = {
|
|
645
646
|
q_child: "q_child_example", # String | query id/title terms to search for child nodes. Allows wildcard searching with '*'
|
646
647
|
q_parent: "q_parent_example", # String | query id/title terms to search for parent nodes. Allows wildcard searching with '*'
|
647
648
|
q_descendant: "q_descendant_example", # String | query id/title terms to search for descendant nodes. Allows wildcard searching with '*'
|
648
|
-
q_ancestor: "q_ancestor_example" # String | query id/title terms to search for ancestor nodes. Allows wildcard searching with '*'
|
649
|
+
q_ancestor: "q_ancestor_example", # String | query id/title terms to search for ancestor nodes. Allows wildcard searching with '*'
|
650
|
+
filter_asset_node: ["filter_asset_node_example"] # Array<String> | limit to nodes that have an asset related to another node matching type/code
|
649
651
|
}
|
650
652
|
|
651
653
|
begin
|
@@ -664,7 +666,8 @@ Name | Type | Description | Notes
|
|
664
666
|
**namespace_inc_global** | **String**| identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call. |
|
665
667
|
**offset** | [**Float**](.md)| index to start result set from | [optional]
|
666
668
|
**limit** | [**Float**](.md)| number of records to return | [optional]
|
667
|
-
**include** | [**Array<String>**](String.md)| comma separated list of elements to hydrate. Can include children, parents, and/or assets | [optional]
|
669
|
+
**include** | [**Array<String>**](String.md)| comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets | [optional]
|
670
|
+
**filter_asset** | [**Array<String>**](String.md)| limit to nodes that have an asset matching type/code | [optional]
|
668
671
|
**filter_node_type** | [**Array<String>**](String.md)| type of nodes to return | [optional]
|
669
672
|
**filter_child** | [**Array<String>**](String.md)| limit to nodes with children matching type/code | [optional]
|
670
673
|
**filter_parent** | [**Array<String>**](String.md)| limit to nodes with parent matching type/code | [optional]
|
@@ -679,6 +682,7 @@ Name | Type | Description | Notes
|
|
679
682
|
**q_parent** | **String**| query id/title terms to search for parent nodes. Allows wildcard searching with '*' | [optional]
|
680
683
|
**q_descendant** | **String**| query id/title terms to search for descendant nodes. Allows wildcard searching with '*' | [optional]
|
681
684
|
**q_ancestor** | **String**| query id/title terms to search for ancestor nodes. Allows wildcard searching with '*' | [optional]
|
685
|
+
**filter_asset_node** | [**Array<String>**](String.md)| limit to nodes that have an asset related to another node matching type/code | [optional]
|
682
686
|
|
683
687
|
### Return type
|
684
688
|
|
data/git_push.sh
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
|
10
|
+
if [ "$git_user_id" = "" ]; then
|
11
|
+
git_user_id="talis"
|
12
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
13
|
+
fi
|
14
|
+
|
15
|
+
if [ "$git_repo_id" = "" ]; then
|
16
|
+
git_repo_id="blueprint_rb"
|
17
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
18
|
+
fi
|
19
|
+
|
20
|
+
if [ "$release_note" = "" ]; then
|
21
|
+
release_note="Minor update"
|
22
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
23
|
+
fi
|
24
|
+
|
25
|
+
# Initialize the local directory as a Git repository
|
26
|
+
git init
|
27
|
+
|
28
|
+
# Adds the files in the local repository and stages them for commit.
|
29
|
+
git add .
|
30
|
+
|
31
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
32
|
+
git commit -m "$release_note"
|
33
|
+
|
34
|
+
# Sets the new remote
|
35
|
+
git_remote=`git remote`
|
36
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
37
|
+
|
38
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
39
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
40
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
41
|
+
else
|
42
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
43
|
+
fi
|
44
|
+
|
45
|
+
fi
|
46
|
+
|
47
|
+
git pull origin master
|
48
|
+
|
49
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
50
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
51
|
+
git push origin master 2>&1 | grep -v 'To https'
|
52
|
+
|
@@ -602,5 +602,115 @@ module BlueprintClient
|
|
602
602
|
end
|
603
603
|
return data, status_code, headers
|
604
604
|
end
|
605
|
+
|
606
|
+
# Search assets
|
607
|
+
# This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.\nThe include parameter can only be set to `nodes`\n\n###### Find all assets in namespace abc\n`/1/abc/assets`\n\n###### Find all lists for abc:\n`/1/abc/assets?filter[assetType]=lists`\n\n###### Find all assets that are related to a given node of DEP101:\n`/1/abc/assets?filter[node]=departments%2Fdep101`\n\n###### Find all assets that are related to both node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101&filter[node]=departments%2Fdep102`\n\n###### Find all assets that are related to either node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101,departments%2Fdep102`\n
|
608
|
+
# @param namespace identifier namespacing the blueprint.
|
609
|
+
# @param [Hash] opts the optional parameters
|
610
|
+
# @option opts [Float] :offset index to start result set from
|
611
|
+
# @option opts [Float] :limit number of records to return
|
612
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
613
|
+
# @option opts [Array<String>] :filter_node limit to assets that are related to a node matching type/code
|
614
|
+
# @option opts [Array<String>] :filter_asset_type type of asset to return
|
615
|
+
# @return [AssetResultSet]
|
616
|
+
def search_assets(namespace, opts = {})
|
617
|
+
data, _status_code, _headers = search_assets_with_http_info(namespace, opts)
|
618
|
+
return data
|
619
|
+
end
|
620
|
+
|
621
|
+
# Search assets
|
622
|
+
# This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.\nThe include parameter can only be set to `nodes`\n\n###### Find all assets in namespace abc\n`/1/abc/assets`\n\n###### Find all lists for abc:\n`/1/abc/assets?filter[assetType]=lists`\n\n###### Find all assets that are related to a given node of DEP101:\n`/1/abc/assets?filter[node]=departments%2Fdep101`\n\n###### Find all assets that are related to both node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101&filter[node]=departments%2Fdep102`\n\n###### Find all assets that are related to either node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101,departments%2Fdep102`\n
|
623
|
+
# @param namespace identifier namespacing the blueprint.
|
624
|
+
# @param [Hash] opts the optional parameters
|
625
|
+
# @option opts [Float] :offset index to start result set from
|
626
|
+
# @option opts [Float] :limit number of records to return
|
627
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
628
|
+
# @option opts [Array<String>] :filter_node limit to assets that are related to a node matching type/code
|
629
|
+
# @option opts [Array<String>] :filter_asset_type type of asset to return
|
630
|
+
# @return [Array<(AssetResultSet, Fixnum, Hash)>] AssetResultSet data, response status code and response headers
|
631
|
+
def search_assets_with_http_info(namespace, opts = {})
|
632
|
+
if @api_client.config.debugging
|
633
|
+
@api_client.config.logger.debug "Calling API: AssetsApi.search_assets ..."
|
634
|
+
end
|
635
|
+
|
636
|
+
|
637
|
+
# verify the required parameter 'namespace' is set
|
638
|
+
fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.search_assets" if namespace.nil?
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
# resource path
|
675
|
+
local_var_path = "/{namespace}/assets".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s)
|
676
|
+
|
677
|
+
# query parameters
|
678
|
+
query_params = {}
|
679
|
+
query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
|
680
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
681
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include']
|
682
|
+
query_params[:'filter[node]'] = @api_client.build_collection_param(opts[:'filter_node'], :csv) if opts[:'filter_node']
|
683
|
+
query_params[:'filter[assetType]'] = @api_client.build_collection_param(opts[:'filter_asset_type'], :csv) if opts[:'filter_asset_type']
|
684
|
+
|
685
|
+
# header parameters
|
686
|
+
header_params = {}
|
687
|
+
|
688
|
+
# HTTP header 'Accept' (if needed)
|
689
|
+
local_header_accept = ['application/vnd.api+json']
|
690
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
691
|
+
|
692
|
+
# HTTP header 'Content-Type'
|
693
|
+
local_header_content_type = ['application/json']
|
694
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
695
|
+
|
696
|
+
# form parameters
|
697
|
+
form_params = {}
|
698
|
+
|
699
|
+
# http body (model)
|
700
|
+
post_body = nil
|
701
|
+
|
702
|
+
auth_names = ['oauth2']
|
703
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
704
|
+
:header_params => header_params,
|
705
|
+
:query_params => query_params,
|
706
|
+
:form_params => form_params,
|
707
|
+
:body => post_body,
|
708
|
+
:auth_names => auth_names,
|
709
|
+
:return_type => 'AssetResultSet')
|
710
|
+
if @api_client.config.debugging
|
711
|
+
@api_client.config.logger.debug "API called: AssetsApi#search_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
712
|
+
end
|
713
|
+
return data, status_code, headers
|
714
|
+
end
|
605
715
|
end
|
606
716
|
end
|
@@ -622,7 +622,7 @@ module BlueprintClient
|
|
622
622
|
# @param id id identifying a domain model
|
623
623
|
# @param type subtype of Node, e.g. 'modules', 'departments', etc.
|
624
624
|
# @param [Hash] opts the optional parameters
|
625
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
625
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
626
626
|
# @return [NodeBody]
|
627
627
|
def get_node(namespace, id, type, opts = {})
|
628
628
|
data, _status_code, _headers = get_node_with_http_info(namespace, id, type, opts)
|
@@ -635,7 +635,7 @@ module BlueprintClient
|
|
635
635
|
# @param id id identifying a domain model
|
636
636
|
# @param type subtype of Node, e.g. 'modules', 'departments', etc.
|
637
637
|
# @param [Hash] opts the optional parameters
|
638
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
638
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
639
639
|
# @return [Array<(NodeBody, Fixnum, Hash)>] NodeBody data, response status code and response headers
|
640
640
|
def get_node_with_http_info(namespace, id, type, opts = {})
|
641
641
|
if @api_client.config.debugging
|
@@ -909,12 +909,13 @@ module BlueprintClient
|
|
909
909
|
end
|
910
910
|
|
911
911
|
# Search nodes
|
912
|
-
# This endpoint is a really flexible way to ask questions about the hierarchy
|
912
|
+
# This endpoint is a really flexible way to ask questions about the hierarchy.\nThe includes parameter can be set to either parents, children, assets.\n\nExamples:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Modules`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101`\n\n###### Find all nodes that are descendants of DEP101 or DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101,departments%2Fdep102`\n\n###### Find all nodes that are descendants of DEP101 and DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101&filter[descendant]=departments%2Fdep102``\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=modules%2Fabf203&filter[nodeType]=Departments` # <= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Modules&filter[ancestor]=departments%2FDEP101&filter[hasAssets]=true&filter[assetType]=Lists`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[assetType]=Lists`\n\n###### Find all nodes of type modules during 2015 that have no assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[from]=20150101&filter[to]=20151231`\n\n###### Find all nodes of type modules with assets which are also related to DEP101.\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=true&filter[assetNode]=departments%2Fdep101`\n
|
913
913
|
# @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
|
914
914
|
# @param [Hash] opts the optional parameters
|
915
915
|
# @option opts [Float] :offset index to start result set from
|
916
916
|
# @option opts [Float] :limit number of records to return
|
917
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
917
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
918
|
+
# @option opts [Array<String>] :filter_asset limit to nodes that have an asset matching type/code
|
918
919
|
# @option opts [Array<String>] :filter_node_type type of nodes to return
|
919
920
|
# @option opts [Array<String>] :filter_child limit to nodes with children matching type/code
|
920
921
|
# @option opts [Array<String>] :filter_parent limit to nodes with parent matching type/code
|
@@ -929,6 +930,7 @@ module BlueprintClient
|
|
929
930
|
# @option opts [String] :q_parent query id/title terms to search for parent nodes. Allows wildcard searching with '*'
|
930
931
|
# @option opts [String] :q_descendant query id/title terms to search for descendant nodes. Allows wildcard searching with '*'
|
931
932
|
# @option opts [String] :q_ancestor query id/title terms to search for ancestor nodes. Allows wildcard searching with '*'
|
933
|
+
# @option opts [Array<String>] :filter_asset_node limit to nodes that have an asset related to another node matching type/code
|
932
934
|
# @return [NodeResultSet]
|
933
935
|
def search_nodes(namespace_inc_global, opts = {})
|
934
936
|
data, _status_code, _headers = search_nodes_with_http_info(namespace_inc_global, opts)
|
@@ -936,12 +938,13 @@ module BlueprintClient
|
|
936
938
|
end
|
937
939
|
|
938
940
|
# Search nodes
|
939
|
-
# This endpoint is a really flexible way to ask questions about the hierarchy
|
941
|
+
# This endpoint is a really flexible way to ask questions about the hierarchy.\nThe includes parameter can be set to either parents, children, assets.\n\nExamples:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Modules`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101`\n\n###### Find all nodes that are descendants of DEP101 or DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101,departments%2Fdep102`\n\n###### Find all nodes that are descendants of DEP101 and DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101&filter[descendant]=departments%2Fdep102``\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=modules%2Fabf203&filter[nodeType]=Departments` # <= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Modules&filter[ancestor]=departments%2FDEP101&filter[hasAssets]=true&filter[assetType]=Lists`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[assetType]=Lists`\n\n###### Find all nodes of type modules during 2015 that have no assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[from]=20150101&filter[to]=20151231`\n\n###### Find all nodes of type modules with assets which are also related to DEP101.\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=true&filter[assetNode]=departments%2Fdep101`\n
|
940
942
|
# @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
|
941
943
|
# @param [Hash] opts the optional parameters
|
942
944
|
# @option opts [Float] :offset index to start result set from
|
943
945
|
# @option opts [Float] :limit number of records to return
|
944
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
946
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
947
|
+
# @option opts [Array<String>] :filter_asset limit to nodes that have an asset matching type/code
|
945
948
|
# @option opts [Array<String>] :filter_node_type type of nodes to return
|
946
949
|
# @option opts [Array<String>] :filter_child limit to nodes with children matching type/code
|
947
950
|
# @option opts [Array<String>] :filter_parent limit to nodes with parent matching type/code
|
@@ -956,6 +959,7 @@ module BlueprintClient
|
|
956
959
|
# @option opts [String] :q_parent query id/title terms to search for parent nodes. Allows wildcard searching with '*'
|
957
960
|
# @option opts [String] :q_descendant query id/title terms to search for descendant nodes. Allows wildcard searching with '*'
|
958
961
|
# @option opts [String] :q_ancestor query id/title terms to search for ancestor nodes. Allows wildcard searching with '*'
|
962
|
+
# @option opts [Array<String>] :filter_asset_node limit to nodes that have an asset related to another node matching type/code
|
959
963
|
# @return [Array<(NodeResultSet, Fixnum, Hash)>] NodeResultSet data, response status code and response headers
|
960
964
|
def search_nodes_with_http_info(namespace_inc_global, opts = {})
|
961
965
|
if @api_client.config.debugging
|
@@ -1059,6 +1063,18 @@ module BlueprintClient
|
|
1059
1063
|
|
1060
1064
|
|
1061
1065
|
|
1066
|
+
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
|
1075
|
+
|
1076
|
+
|
1077
|
+
|
1062
1078
|
|
1063
1079
|
|
1064
1080
|
|
@@ -1080,6 +1096,7 @@ module BlueprintClient
|
|
1080
1096
|
query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
|
1081
1097
|
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
1082
1098
|
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include']
|
1099
|
+
query_params[:'filter[asset]'] = @api_client.build_collection_param(opts[:'filter_asset'], :csv) if opts[:'filter_asset']
|
1083
1100
|
query_params[:'filter[nodeType]'] = @api_client.build_collection_param(opts[:'filter_node_type'], :csv) if opts[:'filter_node_type']
|
1084
1101
|
query_params[:'filter[child]'] = @api_client.build_collection_param(opts[:'filter_child'], :csv) if opts[:'filter_child']
|
1085
1102
|
query_params[:'filter[parent]'] = @api_client.build_collection_param(opts[:'filter_parent'], :csv) if opts[:'filter_parent']
|
@@ -1094,6 +1111,7 @@ module BlueprintClient
|
|
1094
1111
|
query_params[:'q[parent]'] = opts[:'q_parent'] if opts[:'q_parent']
|
1095
1112
|
query_params[:'q[descendant]'] = opts[:'q_descendant'] if opts[:'q_descendant']
|
1096
1113
|
query_params[:'q[ancestor]'] = opts[:'q_ancestor'] if opts[:'q_ancestor']
|
1114
|
+
query_params[:'filter[asset.node]'] = @api_client.build_collection_param(opts[:'filter_asset_node'], :csv) if opts[:'filter_asset_node']
|
1097
1115
|
|
1098
1116
|
# header parameters
|
1099
1117
|
header_params = {}
|
@@ -21,6 +21,8 @@ module BlueprintClient
|
|
21
21
|
|
22
22
|
attr_accessor :attributes
|
23
23
|
|
24
|
+
attr_accessor :relationships
|
25
|
+
|
24
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
27
|
def self.attribute_map
|
26
28
|
{
|
@@ -29,7 +31,9 @@ module BlueprintClient
|
|
29
31
|
|
30
32
|
:'type' => :'type',
|
31
33
|
|
32
|
-
:'attributes' => :'attributes'
|
34
|
+
:'attributes' => :'attributes',
|
35
|
+
|
36
|
+
:'relationships' => :'relationships'
|
33
37
|
|
34
38
|
}
|
35
39
|
end
|
@@ -42,7 +46,9 @@ module BlueprintClient
|
|
42
46
|
|
43
47
|
:'type' => :'String',
|
44
48
|
|
45
|
-
:'attributes' => :'Object'
|
49
|
+
:'attributes' => :'Object',
|
50
|
+
|
51
|
+
:'relationships' => :'AssetRelationships'
|
46
52
|
|
47
53
|
}
|
48
54
|
end
|
@@ -83,6 +89,15 @@ module BlueprintClient
|
|
83
89
|
end
|
84
90
|
|
85
91
|
|
92
|
+
if attributes.has_key?(:'relationships')
|
93
|
+
|
94
|
+
|
95
|
+
self.relationships = attributes[:'relationships']
|
96
|
+
|
97
|
+
|
98
|
+
end
|
99
|
+
|
100
|
+
|
86
101
|
end
|
87
102
|
|
88
103
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -120,6 +135,10 @@ module BlueprintClient
|
|
120
135
|
|
121
136
|
|
122
137
|
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
123
142
|
end
|
124
143
|
|
125
144
|
|
@@ -136,6 +155,11 @@ module BlueprintClient
|
|
136
155
|
|
137
156
|
|
138
157
|
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
139
163
|
|
140
164
|
|
141
165
|
# Checks equality by comparing each attribute.
|
@@ -145,7 +169,8 @@ module BlueprintClient
|
|
145
169
|
self.class == o.class &&
|
146
170
|
id == o.id &&
|
147
171
|
type == o.type &&
|
148
|
-
attributes == o.attributes
|
172
|
+
attributes == o.attributes &&
|
173
|
+
relationships == o.relationships
|
149
174
|
end
|
150
175
|
|
151
176
|
# @see the `==` method
|
@@ -157,7 +182,7 @@ module BlueprintClient
|
|
157
182
|
# Calculates hash code according to all attributes.
|
158
183
|
# @return [Fixnum] Hash code
|
159
184
|
def hash
|
160
|
-
[id, type, attributes].hash
|
185
|
+
[id, type, attributes, relationships].hash
|
161
186
|
end
|
162
187
|
|
163
188
|
# Builds the object from hash
|
@@ -0,0 +1,207 @@
|
|
1
|
+
=begin
|
2
|
+
Talis Blueprint API
|
3
|
+
|
4
|
+
This is the API documentation for [Blueprint](https://github.com/talis/blueprint-server), a primitive for institutional structure and time periods
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module BlueprintClient
|
16
|
+
class AssetRelationships
|
17
|
+
attr_accessor :nodes
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
|
23
|
+
:'nodes' => :'nodes'
|
24
|
+
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.swagger_types
|
30
|
+
{
|
31
|
+
|
32
|
+
:'nodes' => :'NodeRelationship'
|
33
|
+
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
44
|
+
|
45
|
+
|
46
|
+
if attributes.has_key?(:'nodes')
|
47
|
+
|
48
|
+
|
49
|
+
self.nodes = attributes[:'nodes']
|
50
|
+
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properies with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
|
62
|
+
|
63
|
+
return invalid_properties
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check to see if the all the properties in the model are valid
|
67
|
+
# @return true if the model is valid
|
68
|
+
def valid?
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
nodes == o.nodes
|
88
|
+
end
|
89
|
+
|
90
|
+
# @see the `==` method
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def eql?(o)
|
93
|
+
self == o
|
94
|
+
end
|
95
|
+
|
96
|
+
# Calculates hash code according to all attributes.
|
97
|
+
# @return [Fixnum] Hash code
|
98
|
+
def hash
|
99
|
+
[nodes].hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def build_from_hash(attributes)
|
106
|
+
return nil unless attributes.is_a?(Hash)
|
107
|
+
self.class.swagger_types.each_pair do |key, type|
|
108
|
+
if type =~ /^Array<(.*)>/i
|
109
|
+
# check to ensure the input is an array given that the the attribute
|
110
|
+
# is documented as an array but the input is not
|
111
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
112
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
113
|
+
end
|
114
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
115
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
116
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
117
|
+
end
|
118
|
+
|
119
|
+
self
|
120
|
+
end
|
121
|
+
|
122
|
+
# Deserializes the data based on type
|
123
|
+
# @param string type Data type
|
124
|
+
# @param string value Value to be deserialized
|
125
|
+
# @return [Object] Deserialized data
|
126
|
+
def _deserialize(type, value)
|
127
|
+
case type.to_sym
|
128
|
+
when :DateTime
|
129
|
+
DateTime.parse(value)
|
130
|
+
when :Date
|
131
|
+
Date.parse(value)
|
132
|
+
when :String
|
133
|
+
value.to_s
|
134
|
+
when :Integer
|
135
|
+
value.to_i
|
136
|
+
when :Float
|
137
|
+
value.to_f
|
138
|
+
when :BOOLEAN
|
139
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
140
|
+
true
|
141
|
+
else
|
142
|
+
false
|
143
|
+
end
|
144
|
+
when :Object
|
145
|
+
# generic object (usually a Hash), return directly
|
146
|
+
value
|
147
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
148
|
+
inner_type = Regexp.last_match[:inner_type]
|
149
|
+
value.map { |v| _deserialize(inner_type, v) }
|
150
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
151
|
+
k_type = Regexp.last_match[:k_type]
|
152
|
+
v_type = Regexp.last_match[:v_type]
|
153
|
+
{}.tap do |hash|
|
154
|
+
value.each do |k, v|
|
155
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
else # model
|
159
|
+
temp_model = BlueprintClient.const_get(type).new
|
160
|
+
temp_model.build_from_hash(value)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the string representation of the object
|
165
|
+
# @return [String] String presentation of the object
|
166
|
+
def to_s
|
167
|
+
to_hash.to_s
|
168
|
+
end
|
169
|
+
|
170
|
+
# to_body is an alias to to_hash (backward compatibility)
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
172
|
+
def to_body
|
173
|
+
to_hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the object in the form of hash
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
178
|
+
def to_hash
|
179
|
+
hash = {}
|
180
|
+
self.class.attribute_map.each_pair do |attr, param|
|
181
|
+
value = self.send(attr)
|
182
|
+
next if value.nil?
|
183
|
+
hash[param] = _to_hash(value)
|
184
|
+
end
|
185
|
+
hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Outputs non-array value in the form of hash
|
189
|
+
# For object, use to_hash. Otherwise, just return the value
|
190
|
+
# @param [Object] value Any valid value
|
191
|
+
# @return [Hash] Returns the value in the form of hash
|
192
|
+
def _to_hash(value)
|
193
|
+
if value.is_a?(Array)
|
194
|
+
value.compact.map{ |v| _to_hash(v) }
|
195
|
+
elsif value.is_a?(Hash)
|
196
|
+
{}.tap do |hash|
|
197
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
198
|
+
end
|
199
|
+
elsif value.respond_to? :to_hash
|
200
|
+
value.to_hash
|
201
|
+
else
|
202
|
+
value
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
207
|
+
end
|
@@ -20,6 +20,7 @@ require 'blueprint_ruby_client/configuration'
|
|
20
20
|
require 'blueprint_ruby_client/models/asset'
|
21
21
|
require 'blueprint_ruby_client/models/asset_body'
|
22
22
|
require 'blueprint_ruby_client/models/asset_relationship'
|
23
|
+
require 'blueprint_ruby_client/models/asset_relationships'
|
23
24
|
require 'blueprint_ruby_client/models/asset_result_set'
|
24
25
|
require 'blueprint_ruby_client/models/error'
|
25
26
|
require 'blueprint_ruby_client/models/errors'
|
data/spec/api/assets_api_spec.rb
CHANGED
@@ -148,4 +148,25 @@ describe 'AssetsApi' do
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
+
# unit tests for search_assets
|
152
|
+
# Search assets
|
153
|
+
# This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.\nThe include parameter can only be set to `nodes`\n\n###### Find all assets in namespace abc\n`/1/abc/assets`\n\n###### Find all lists for abc:\n`/1/abc/assets?filter[assetType]=lists`\n\n###### Find all assets that are related to a given node of DEP101:\n`/1/abc/assets?filter[node]=departments%2Fdep101`\n\n###### Find all assets that are related to both node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101&filter[node]=departments%2Fdep102`\n\n###### Find all assets that are related to either node DEP101 and DEP102:\n`/1/abc/assets?filter[node]=departments%2Fdep101,departments%2Fdep102`\n
|
154
|
+
# @param namespace identifier namespacing the blueprint.
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @option opts [Float] :offset index to start result set from
|
157
|
+
# @option opts [Float] :limit number of records to return
|
158
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
159
|
+
# @option opts [Array<String>] :filter_node limit to assets that are related to a node matching type/code
|
160
|
+
# @option opts [Array<String>] :filter_asset_type type of asset to return
|
161
|
+
# @return [AssetResultSet]
|
162
|
+
describe 'search_assets test' do
|
163
|
+
it "should work" do
|
164
|
+
# assertion here
|
165
|
+
# should be_a()
|
166
|
+
# should be_nil
|
167
|
+
# should ==
|
168
|
+
# should_not ==
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
151
172
|
end
|
@@ -166,7 +166,7 @@ describe 'HierarchyApi' do
|
|
166
166
|
# @param id id identifying a domain model
|
167
167
|
# @param type subtype of Node, e.g. 'modules', 'departments', etc.
|
168
168
|
# @param [Hash] opts the optional parameters
|
169
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
169
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
170
170
|
# @return [NodeBody]
|
171
171
|
describe 'get_node test' do
|
172
172
|
it "should work" do
|
@@ -219,12 +219,13 @@ describe 'HierarchyApi' do
|
|
219
219
|
|
220
220
|
# unit tests for search_nodes
|
221
221
|
# Search nodes
|
222
|
-
# This endpoint is a really flexible way to ask questions about the hierarchy
|
222
|
+
# This endpoint is a really flexible way to ask questions about the hierarchy.\nThe includes parameter can be set to either parents, children, assets.\n\nExamples:\n\n###### Find all nodes for abc:\n`/1/abc/nodes`\n\n###### Find all modules for abc:\n`/1/abc/nodes?filter[nodeType]=Modules`\n\n###### Find all nodes that are descendants of DEP101:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101`\n\n###### Find all nodes that are descendants of DEP101 or DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101,departments%2Fdep102`\n\n###### Find all nodes that are descendants of DEP101 and DEP102:\n`/1/abc/nodes?filter[descendant]=departments%2Fdep101&filter[descendant]=departments%2Fdep102``\n\n###### Find all Departments that are ancestors of ABF203:\n`/1/abc/nodes?filter[descendant]=modules%2Fabf203&filter[nodeType]=Departments` # <= case insensitive\n\n###### Find all nodes with list assets that are descendants of DEP101 for abc:\n`/1/abc/nodes?filter[nodeType]=Modules&filter[ancestor]=departments%2FDEP101&filter[hasAssets]=true&filter[assetType]=Lists`\n\n###### Globally, find all modules that have no list assets\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[assetType]=Lists`\n\n###### Find all nodes of type modules during 2015 that have no assets. Note a node's valid_from/valid_to just need to overlap from/to to qualify\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=false&filter[from]=20150101&filter[to]=20151231`\n\n###### Find all nodes of type modules with assets which are also related to DEP101.\n`/1/global/nodes?filter[nodeType]=Modules&filter[hasAssets]=true&filter[assetNode]=departments%2Fdep101`\n
|
223
223
|
# @param namespace_inc_global identifier namespacing the blueprint. `global` is a special namespace which references data from all blueprints in the call.
|
224
224
|
# @param [Hash] opts the optional parameters
|
225
225
|
# @option opts [Float] :offset index to start result set from
|
226
226
|
# @option opts [Float] :limit number of records to return
|
227
|
-
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, and/or assets
|
227
|
+
# @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets
|
228
|
+
# @option opts [Array<String>] :filter_asset limit to nodes that have an asset matching type/code
|
228
229
|
# @option opts [Array<String>] :filter_node_type type of nodes to return
|
229
230
|
# @option opts [Array<String>] :filter_child limit to nodes with children matching type/code
|
230
231
|
# @option opts [Array<String>] :filter_parent limit to nodes with parent matching type/code
|
@@ -239,6 +240,7 @@ describe 'HierarchyApi' do
|
|
239
240
|
# @option opts [String] :q_parent query id/title terms to search for parent nodes. Allows wildcard searching with '*'
|
240
241
|
# @option opts [String] :q_descendant query id/title terms to search for descendant nodes. Allows wildcard searching with '*'
|
241
242
|
# @option opts [String] :q_ancestor query id/title terms to search for ancestor nodes. Allows wildcard searching with '*'
|
243
|
+
# @option opts [Array<String>] :filter_asset_node limit to nodes that have an asset related to another node matching type/code
|
242
244
|
# @return [NodeResultSet]
|
243
245
|
describe 'search_nodes test' do
|
244
246
|
it "should work" do
|
@@ -0,0 +1,46 @@
|
|
1
|
+
=begin
|
2
|
+
Talis Blueprint API
|
3
|
+
|
4
|
+
This is the API documentation for [Blueprint](https://github.com/talis/blueprint-server), a primitive for institutional structure and time periods
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for BlueprintClient::AssetRelationships
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'AssetRelationships' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = BlueprintClient::AssetRelationships.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of AssetRelationships' do
|
31
|
+
it 'should create an instact of AssetRelationships' do
|
32
|
+
@instance.should be_a(BlueprintClient::AssetRelationships)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "nodes"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here
|
38
|
+
# should be_a()
|
39
|
+
# should be_nil
|
40
|
+
# should ==
|
41
|
+
# should_not ==
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
data/spec/models/asset_spec.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueprint_ruby_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Paddock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -201,11 +201,13 @@ files:
|
|
201
201
|
- Gemfile.lock
|
202
202
|
- LICENSE
|
203
203
|
- README.md
|
204
|
+
- blueprint_ruby_client-0.5.1.gem
|
204
205
|
- blueprint_ruby_client.gemspec
|
205
206
|
- config.json
|
206
207
|
- docs/Asset.md
|
207
208
|
- docs/AssetBody.md
|
208
209
|
- docs/AssetRelationship.md
|
210
|
+
- docs/AssetRelationships.md
|
209
211
|
- docs/AssetResultSet.md
|
210
212
|
- docs/AssetTypeConfigsApi.md
|
211
213
|
- docs/AssetTypeTemplatesApi.md
|
@@ -237,6 +239,7 @@ files:
|
|
237
239
|
- docs/TemplateBody.md
|
238
240
|
- docs/TemplateVariables.md
|
239
241
|
- generate.sh
|
242
|
+
- git_push.sh
|
240
243
|
- lib/blueprint_ruby_client.rb
|
241
244
|
- lib/blueprint_ruby_client/api/asset_type_configs_api.rb
|
242
245
|
- lib/blueprint_ruby_client/api/asset_type_templates_api.rb
|
@@ -251,6 +254,7 @@ files:
|
|
251
254
|
- lib/blueprint_ruby_client/models/asset.rb
|
252
255
|
- lib/blueprint_ruby_client/models/asset_body.rb
|
253
256
|
- lib/blueprint_ruby_client/models/asset_relationship.rb
|
257
|
+
- lib/blueprint_ruby_client/models/asset_relationships.rb
|
254
258
|
- lib/blueprint_ruby_client/models/asset_result_set.rb
|
255
259
|
- lib/blueprint_ruby_client/models/error.rb
|
256
260
|
- lib/blueprint_ruby_client/models/errors.rb
|
@@ -284,6 +288,7 @@ files:
|
|
284
288
|
- spec/api/security_api_spec.rb
|
285
289
|
- spec/models/asset_body_spec.rb
|
286
290
|
- spec/models/asset_relationship_spec.rb
|
291
|
+
- spec/models/asset_relationships_spec.rb
|
287
292
|
- spec/models/asset_result_set_spec.rb
|
288
293
|
- spec/models/asset_spec.rb
|
289
294
|
- spec/models/error_spec.rb
|
@@ -308,6 +313,7 @@ files:
|
|
308
313
|
- spec/models/template_body_spec.rb
|
309
314
|
- spec/models/template_spec.rb
|
310
315
|
- spec/models/template_variables_spec.rb
|
316
|
+
- swagger-codegen-cli.jar
|
311
317
|
- templates/Gemfile.mustache
|
312
318
|
- templates/README.mustache
|
313
319
|
- templates/api.mustache
|
@@ -359,6 +365,7 @@ test_files:
|
|
359
365
|
- spec/api/security_api_spec.rb
|
360
366
|
- spec/models/asset_body_spec.rb
|
361
367
|
- spec/models/asset_relationship_spec.rb
|
368
|
+
- spec/models/asset_relationships_spec.rb
|
362
369
|
- spec/models/asset_result_set_spec.rb
|
363
370
|
- spec/models/asset_spec.rb
|
364
371
|
- spec/models/error_spec.rb
|