Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage Encapsulated Functional #13

Closed
jjj4x opened this issue Nov 25, 2017 · 2 comments
Closed

Leverage Encapsulated Functional #13

jjj4x opened this issue Nov 25, 2017 · 2 comments

Comments

@jjj4x
Copy link

jjj4x commented Nov 25, 2017

There's an encapsulated functional that doesn't seem to be in the Public API.

More specifically:

  1. Workitems have protected attribute _data: workitem._data which is a dict()
  2. Inside the dict() there's an interesting key relations (workitem._data["relations"])
  3. The relations is a list() which contains multiple dict() objects
  4. The practical value lies in dict() objects that represent an attached file

Concrete example:
...
logging.info(workitem._data["relations"][-1])
...

STDOUT:
{'rel': 'AttachedFile', 'url': '<uniquely identified link to the file>', 'attributes': {'authorizedDate': '2017-01-09T14:49:32.633Z', 'id': ..., 'resourceCreatedDate': '2017-01-09T14:49:10.473Z', 'resourceModifiedDate': '2017-01-09T14:49:10.473Z', 'revisedDate': '9999-01-01T00:00:00Z', 'resourceSize': 100937, 'name': '<filename>.png'}}

I'm still not sure, but it seems that the ability to work with attached files is already encapsulated.

Another interesting key is workitem._data["_links"], which contains:
{'self': {'href': '<link to the workitem in JSON>'}, 'workItemUpdates': {'href': '...'}, 'workItemRevisions': {'href': '...'}, 'workItemHistory': {'href': '<link to workitem's comments in JSON>'}, 'html': {'...'}, 'workItemType': {'...'}, 'fields': {'href': '...'}}

@allburov
Copy link
Member

allburov commented Jan 6, 2018

Will be fix in #16

allburov added a commit that referenced this issue Jan 9, 2018
Fix #15
Fix #13 

* Add dynamic attribute from _links

* remove old repsonse.json

* Add Atachment object and download method

* try to fix test

* escape /

* add revisions as property

* Add more docs

* omit test coverage

* duplicate test name

* source dir to coverage

* rtfm codacy manual

* Add docs, deploy on develop\master only

* star repo
@allburov
Copy link
Member

allburov commented Jan 9, 2018

ondrno pushed a commit to ondrno/tfs that referenced this issue Dec 20, 2018
Fix devopshq#15
Fix devopshq#13 

* Add dynamic attribute from _links

* remove old repsonse.json

* Add Atachment object and download method

* try to fix test

* escape /

* add revisions as property

* Add more docs

* omit test coverage

* duplicate test name

* source dir to coverage

* rtfm codacy manual

* Add docs, deploy on develop\master only

* star repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants