{
    "definitions": {
        "base": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "couponUse": {
                    "description": "クーポン使用中（クーポンON）の場合に true, それ以外は false",
                    "example": false,
                    "type": [
                        "boolean"
                    ]
                },
                "hddServiceCode": {
                    "description": "hddサービスコード",
                    "example": "hdd01234567",
                    "type": [
                        "string"
                    ]
                },
                "hdoServiceCode": {
                    "description": "hdoサービスコード",
                    "example": "hdo01234567",
                    "type": [
                        "string"
                    ]
                },
                "plan": {
                    "description": "プラン名",
                    "enum": [
                        "Family Share",
                        "Minimum Start",
                        "Light Start"
                    ],
                    "example": "Family Share",
                    "type": [
                        "string"
                    ]
                },
                "returnCode": {
                    "description": "リターンコード",
                    "example": "OK",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "FIXME",
            "links": [],
            "properties": {},
            "title": "IIJmio Coupon API - Base",
            "type": [
                "object"
            ]
        },
        "coupon": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "coupon": {
                    "properties": {
                        "expire": {
                            "$ref": "#/definitions/coupon/definitions/expire"
                        },
                        "type": {
                            "$ref": "#/definitions/coupon/definitions/type"
                        },
                        "volume": {
                            "$ref": "#/definitions/coupon/definitions/volume"
                        }
                    },
                    "required": [
                        "volume",
                        "expire",
                        "type"
                    ],
                    "type": [
                        "object"
                    ]
                },
                "expire": {
                    "description": "クーポン有効期限月",
                    "example": "201403",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "iccid": {
                    "description": "回線のICCID",
                    "example": "DN000011112222",
                    "type": [
                        "string"
                    ]
                },
                "number": {
                    "description": "回線の電話番号",
                    "example": "08011112222",
                    "type": [
                        "string"
                    ]
                },
                "regulation": {
                    "description": "通信規制中の場合に true, それ以外は false",
                    "example": false,
                    "type": [
                        "boolean"
                    ]
                },
                "sms": {
                    "description": "SMS機能付きの場合に true, それ以外は false（音声通話機能付きSIMカードの場合も true が返ります）",
                    "example": false,
                    "type": [
                        "boolean"
                    ]
                },
                "type": {
                    "description": "バンドルクーポンの場合に bundle, 追加クーポンの場合に topup, SIM内クーポンの場合に sim",
                    "enum": [
                        "bundle",
                        "topup",
                        "sim"
                    ],
                    "example": "bundle",
                    "type": [
                        "string"
                    ]
                },
                "voice": {
                    "description": "音声通話機能付きの場合に true, それ以外は false",
                    "example": false,
                    "type": [
                        "boolean"
                    ]
                },
                "volume": {
                    "description": "クーポン残量 (MB単位)",
                    "example": 42,
                    "type": [
                        "integer"
                    ]
                }
            },
            "description": "クーポン状態の照会と切り替え",
            "links": [
                {
                    "description": "クーポン残量とクーポンのON/OFF状態を照会します",
                    "href": "/coupon/",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "クーポンのON/OFFを切り替えます。クーポン利用状態が変化しないリクエスト(現在 couponUse: true な回線に対する couponUse: true のリクエストなど)の場合もエラーとして判定されず、正常応答(200)が返ります",
                    "href": "/coupon/",
                    "method": "PUT",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "couponInfo": {
                                "description": "クーポン情報",
                                "items": {
                                    "properties": {
                                        "hdoInfo": {
                                            "items": {
                                                "properties": {
                                                    "couponUse": {
                                                        "$ref": "#/definitions/base/definitions/couponUse"
                                                    },
                                                    "hdoServiceCode": {
                                                        "$ref": "#/definitions/base/definitions/hdoServiceCode"
                                                    }
                                                },
                                                "required": [
                                                    "hdoServiceCode",
                                                    "couponUse"
                                                ],
                                                "type": [
                                                    "object"
                                                ]
                                            },
                                            "type": [
                                                "array"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "hdoInfo"
                                    ],
                                    "type": [
                                        "object"
                                    ]
                                },
                                "type": [
                                    "array"
                                ]
                            }
                        },
                        "required": [
                            "couponInfo"
                        ],
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Change"
                }
            ],
            "properties": {
                "couponInfo": {
                    "items": {
                        "properties": {
                            "coupon": {
                                "items": {
                                    "$ref": "#/definitions/coupon/definitions/coupon"
                                },
                                "type": [
                                    "array"
                                ]
                            },
                            "hddServiceCode": {
                                "$ref": "#/definitions/base/definitions/hddServiceCode"
                            },
                            "hdoInfo": {
                                "items": {
                                    "properties": {
                                        "coupon": {
                                            "items": {
                                                "$ref": "#/definitions/coupon/definitions/coupon"
                                            },
                                            "type": [
                                                "array"
                                            ]
                                        },
                                        "couponUse": {
                                            "$ref": "#/definitions/base/definitions/couponUse"
                                        },
                                        "hdoServiceCode": {
                                            "$ref": "#/definitions/base/definitions/hdoServiceCode"
                                        },
                                        "iccid": {
                                            "$ref": "#/definitions/coupon/definitions/iccid"
                                        },
                                        "number": {
                                            "$ref": "#/definitions/coupon/definitions/number"
                                        },
                                        "regulation": {
                                            "$ref": "#/definitions/coupon/definitions/regulation"
                                        },
                                        "sms": {
                                            "$ref": "#/definitions/coupon/definitions/sms"
                                        },
                                        "voice": {
                                            "$ref": "#/definitions/coupon/definitions/voice"
                                        }
                                    },
                                    "required": [
                                        "hdoServiceCode",
                                        "number",
                                        "iccid",
                                        "regulation",
                                        "sms",
                                        "voice",
                                        "couponUse",
                                        "coupon"
                                    ],
                                    "type": [
                                        "object"
                                    ]
                                },
                                "type": [
                                    "array"
                                ]
                            },
                            "plan": {
                                "$ref": "#/definitions/base/definitions/plan"
                            }
                        },
                        "required": [
                            "hddServiceCode",
                            "plan",
                            "hdoInfo",
                            "coupon"
                        ],
                        "type": [
                            "object"
                        ]
                    },
                    "type": [
                        "array"
                    ]
                },
                "returnCode": {
                    "$ref": "#/definitions/base/definitions/returnCode"
                }
            },
            "required": [
                "returnCode"
            ],
            "title": "IIJmio Coupon API - Coupon",
            "type": [
                "object"
            ]
        },
        "packet": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "date": {
                    "description": "通信を行った日付",
                    "example": "201403",
                    "type": [
                        "string"
                    ]
                },
                "withCoupon": {
                    "description": "クーポン使用状態でのデータ利用量（MB単位）",
                    "example": 59,
                    "type": [
                        "integer"
                    ]
                },
                "withoutCoupon": {
                    "description": "クーポン不使用状態でのデータ利用量（MB単位）",
                    "example": 21,
                    "type": [
                        "integer"
                    ]
                }
            },
            "description": "データ利用状況",
            "links": [
                {
                    "description": "データ利用量を照会します。過去30日分と当日のデータ利用量（MB単位）が日付順に返ります。通信が行われなかった日についても、0 として値が返ります。",
                    "href": "/log/packet/",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                }
            ],
            "properties": {
                "packetLogInfo": {
                    "items": {
                        "properties": {
                            "hddServiceCode": {
                                "$ref": "#/definitions/base/definitions/hddServiceCode"
                            },
                            "hdoInfo": {
                                "items": {
                                    "properties": {
                                        "hdoServiceCode": {
                                            "$ref": "#/definitions/base/definitions/hdoServiceCode"
                                        },
                                        "packetLog": {
                                            "items": {
                                                "properties": {
                                                    "date": {
                                                        "$ref": "#/definitions/packet/definitions/date"
                                                    },
                                                    "withCoupon": {
                                                        "$ref": "#/definitions/packet/definitions/withCoupon"
                                                    },
                                                    "withoutCoupon": {
                                                        "$ref": "#/definitions/packet/definitions/withoutCoupon"
                                                    }
                                                },
                                                "required": [
                                                    "date",
                                                    "withCoupon",
                                                    "withoutCoupon"
                                                ],
                                                "type": [
                                                    "object"
                                                ]
                                            },
                                            "type": [
                                                "array"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "hdoServiceCode",
                                        "packetLog"
                                    ],
                                    "type": [
                                        "object"
                                    ]
                                },
                                "type": [
                                    "array"
                                ]
                            },
                            "plan": {
                                "$ref": "#/definitions/base/definitions/plan"
                            }
                        },
                        "required": [
                            "hddServiceCode",
                            "plan",
                            "hdoInfo",
                            "coupon"
                        ],
                        "type": [
                            "object"
                        ]
                    },
                    "type": [
                        "array"
                    ]
                },
                "returnCode": {
                    "$ref": "#/definitions/base/definitions/returnCode"
                }
            },
            "required": [
                "returnCode"
            ],
            "title": "IIJmio Coupon API - Packet",
            "type": [
                "object"
            ]
        }
    },
    "description": "IIJmio Coupon API",
    "links": [
        {
            "href": "https://api.iijmio.jp/mobile/d/v1",
            "rel": "self"
        }
    ],
    "properties": {
        "base": {
            "$ref": "#/definitions/base"
        },
        "coupon": {
            "$ref": "#/definitions/coupon"
        },
        "packet": {
            "$ref": "#/definitions/packet"
        }
    },
    "title": "IIJmio",
    "type": [
        "object"
    ]
}