Skip to content

Conversation

@jessepeterson
Copy link
Member

Generate the ABM structs from the Apple Device Services repo using go-jsonschema. Add a single ABM call as an example (for the single service we have supported for now). The re-marshalled JSON exactly matches the raw HTTP json returned from the service:

$ diff -u /tmp/b1o.json /tmp/b2o.json
$ ls -l /tmp/b1o.json /tmp/b2o.json
-rw-r--r--  1 user  wheel  1179 Sep  8 12:21 /tmp/b1o.json
-rw-r--r--  1 user  wheel  1179 Sep  8 12:21 /tmp/b2o.json
$ head -2 /tmp/b1o.json /tmp/b2o.json
==> /tmp/b1o.json <==
{
  "data": [

==> /tmp/b2o.json <==
{
  "data": [

I.e. using this:

	c := goaxm.NewClient(s)

	resp, err := c.ABMv1MDMServers(context.Background(), "myAXMName")
	if err != nil {
		log.Fatal(err)
	}

	err = json.NewEncoder(os.Stdout).Encode(resp)
	if err != nil {
		log.Fatal(err)
	}

(And comparing with the curl transparent reverse proxy)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant